@xriss/weerss 0.0.16 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/shows.js +14 -20
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xriss/weerss",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "source": "weerss.js",
5
5
  "type": "module",
6
6
  "repository": {
package/shows.js CHANGED
@@ -253,13 +253,18 @@ if(weerss.config.debug)
253
253
  }
254
254
 
255
255
  // is this show good?
256
- shows.good_show=function(show,rules)
256
+ shows.good_show=function(show,rules,moretags)
257
257
  {
258
258
  if( !rules ) { return true }
259
259
 
260
260
  let tvmaze=show.tvmaze||{}
261
261
 
262
262
  let flags={}
263
+ if( tvmaze.schedule && tvmaze.schedule.days )
264
+ {
265
+ if( tvmaze.schedule.days.length > 1 ) // flag as soapie if multiple days a week
266
+ { flags[ "soapie" ]=true }
267
+ }
263
268
  if( tvmaze.language ) { flags[ tvmaze.language.trim().toLowerCase() ]=true }
264
269
  if( tvmaze.type ) { flags[ tvmaze.type.trim().toLowerCase() ]=true }
265
270
  if( tvmaze.genres )
@@ -267,6 +272,13 @@ shows.good_show=function(show,rules)
267
272
  {
268
273
  flags[ genre.trim().toLowerCase() ]=true
269
274
  }
275
+ if( moretags )
276
+ {
277
+ for( let tag of moretags )
278
+ {
279
+ flags[ tag.trim().toLowerCase() ]=true
280
+ }
281
+ }
270
282
 
271
283
  return check_flags(flags,rules)
272
284
  }
@@ -274,23 +286,5 @@ shows.good_show=function(show,rules)
274
286
  // is this episode good?
275
287
  shows.good_episode=function(show,rules)
276
288
  {
277
- if( !rules ) { return true }
278
-
279
- let tvmaze=show.tvmaze||{}
280
- let flags={}
281
-
282
- if( tvmaze.language ) { flags[ tvmaze.language.trim().toLowerCase() ]=true }
283
- if( tvmaze.type ) { flags[ tvmaze.type.trim().toLowerCase() ]=true }
284
- if( tvmaze.genres )
285
- for( let genre of tvmaze.genres || [] )
286
- {
287
- flags[ genre.trim().toLowerCase() ]=true
288
- }
289
-
290
- for( let tag of show.tags || [] )
291
- {
292
- flags[ tag.trim().toLowerCase() ]=true
293
- }
294
-
295
- return check_flags(flags,rules)
289
+ return shows.good_show( show , rules , show.tags )
296
290
  }