1
1
import * as R from 'ramda'
2
2
3
+ import { captureErrorEvent } from '~/error-event'
3
4
import { UserInputError } from '~/errors'
4
5
import { createNamespace , decodeId } from '~/internals/graphql'
5
6
import { resolveConnection } from '~/schema/connection/utils'
@@ -112,8 +113,8 @@ export const resolvers: Resolvers = {
112
113
JOIN subject_mapping ON subject_mapping.taxonomy_id = child.parent_id
113
114
-- "Fächer im Aufbau" taxonomy is on the level of normal Serlo subjects, therefore we need a level below it.
114
115
-- "Partner" taxonomy is below the subject "Mathematik", but we only want the entities with the specific partner as the subject.
115
- WHERE child.parent_id NOT IN (87993, 106081, 146728)
116
- -- Exclude content under "Baustelle", "Community", "Zum Testen" and "Testbereich" taxonomies
116
+ -- Exclude content under "Baustelle", "Community" (from de, en and es instances), "Zum Testen" and "Testbereich" taxonomies
117
+ WHERE child.parent_id NOT IN (87993, 106081, 146728, 48537, 164234, 141588, 268835, 146870)
117
118
AND child.id NOT IN (75211, 105140, 107772, 135390, 25107, 106082)
118
119
)
119
120
SELECT
@@ -150,6 +151,7 @@ export const resolvers: Resolvers = {
150
151
AND type.name IN ("applet", "article", "course", "text-exercise",
151
152
"text-exercise-group", "video")
152
153
AND NOT subject_mapping.subject_id = 146728
154
+ AND license.url NOT LIKE "https://www.youtube.com/static?%"
153
155
GROUP BY entity.id
154
156
ORDER BY entity.id
155
157
LIMIT ?
@@ -419,7 +421,9 @@ function getRaWSubject(id: number): RawSubject[] {
419
421
case 18230 :
420
422
return [ { id : '1002' , scheme : Scheme . SchoolSubject } ]
421
423
// Biologie (Schule)
424
+ // Forensik 195927
422
425
case 23362 :
426
+ case 195927 :
423
427
return [ { id : '1001' , scheme : Scheme . SchoolSubject } ]
424
428
// Englisch (Shule)
425
429
case 25979 :
@@ -436,7 +440,6 @@ function getRaWSubject(id: number): RawSubject[] {
436
440
// Informatik (Schule)
437
441
case 47899 :
438
442
return [ { id : '1013' , scheme : Scheme . SchoolSubject } ]
439
-
440
443
// Politik => Politik, Sachunterricht (Schule)
441
444
case 79159 :
442
445
case 107556 :
@@ -460,8 +463,10 @@ function getRaWSubject(id: number): RawSubject[] {
460
463
case 112723 :
461
464
return [ { id : '1006' , scheme : Scheme . SchoolSubject } ]
462
465
// Geschichte (Schule)
466
+ // Estudios en Diásporas Africanas 242308
463
467
case 136362 :
464
468
case 140528 :
469
+ case 242308 :
465
470
return [ { id : '1011' , scheme : Scheme . SchoolSubject } ]
466
471
// Wirtschaftskunde (Schule)
467
472
case 137757 :
@@ -506,7 +511,20 @@ function getRaWSubject(id: number): RawSubject[] {
506
511
{ id : '1043' , scheme : Scheme . SchoolSubject } ,
507
512
{ id : '1005' , scheme : Scheme . SchoolSubject } ,
508
513
]
514
+ // Lerntipps, => Erziehungswissenschaft (Schule)
515
+ case 181883 :
516
+ case 148619 :
517
+ return [ { id : '1043' , scheme : Scheme . SchoolSubject } ]
509
518
default :
519
+ captureErrorEvent ( {
520
+ error : new Error (
521
+ 'metadata: subject could not be mapped to field `about`' ,
522
+ ) ,
523
+ errorContext : {
524
+ subjectId : id ,
525
+ warning : 'It will break the export to Mein Bildungsraum' ,
526
+ } ,
527
+ } )
510
528
return [ ]
511
529
}
512
530
}
0 commit comments