Check for year in coming soon
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
from datetime import date
|
||||||
from couchpotato import get_db
|
from couchpotato import get_db
|
||||||
from couchpotato.api import addApiView
|
from couchpotato.api import addApiView
|
||||||
from couchpotato.core.event import fireEvent
|
from couchpotato.core.event import fireEvent
|
||||||
@@ -43,6 +44,8 @@ class Dashboard(Plugin):
|
|||||||
active_ids = [x['_id'] for x in db.run('media', 'with_status', 'active', with_doc = False)]
|
active_ids = [x['_id'] for x in db.run('media', 'with_status', 'active', with_doc = False)]
|
||||||
|
|
||||||
medias = []
|
medias = []
|
||||||
|
now_year = date.today().year
|
||||||
|
|
||||||
if len(active_ids) > 0:
|
if len(active_ids) > 0:
|
||||||
|
|
||||||
# Order by title or randomize
|
# Order by title or randomize
|
||||||
@@ -70,8 +73,8 @@ class Dashboard(Plugin):
|
|||||||
if coming_soon:
|
if coming_soon:
|
||||||
|
|
||||||
# Don't list older movies
|
# Don't list older movies
|
||||||
if ((not late and (not eta.get('dvd') and not eta.get('theater') or eta.get('dvd') and eta.get('dvd') > (now - 2419200))) or
|
if ((not late and (media['info']['year'] >= now_year-1) and (not eta.get('dvd') and not eta.get('theater') or eta.get('dvd') and eta.get('dvd') > (now - 2419200))) or
|
||||||
(late and (eta.get('dvd', 0) > 0 or eta.get('theater')) and eta.get('dvd') < (now - 2419200))):
|
(late and ((media['info']['year'] < now_year-1) or ((eta.get('dvd', 0) > 0 or eta.get('theater')) and eta.get('dvd') < (now - 2419200))))):
|
||||||
medias.append(media)
|
medias.append(media)
|
||||||
|
|
||||||
if len(medias) >= limit:
|
if len(medias) >= limit:
|
||||||
|
|||||||
Reference in New Issue
Block a user