Merge branch 'refs/heads/develop' into nosql
Conflicts: couchpotato/core/plugins/dashboard/main.py
This commit is contained in:
@@ -276,13 +276,15 @@ class MovieSearcher(SearcherBase, MovieTypeBase):
|
||||
|
||||
now = int(time.time())
|
||||
now_year = date.today().year
|
||||
now_month = date.today().month
|
||||
|
||||
if (year is None or year < now_year - 1) and (not dates or (dates.get('theater', 0) == 0 and dates.get('dvd', 0) == 0)):
|
||||
return True
|
||||
else:
|
||||
|
||||
# Don't allow movies with years to far in the future
|
||||
if year is not None and year > now_year + 1:
|
||||
add_year = 1 if now_month > 10 else 0 # Only allow +1 year if end of the year
|
||||
if year is not None and year > (now_year + add_year):
|
||||
return False
|
||||
|
||||
# For movies before 1972
|
||||
|
||||
7
couchpotato/core/providers/userscript/reddit/__init__.py
Normal file
7
couchpotato/core/providers/userscript/reddit/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from .main import Reddit
|
||||
|
||||
|
||||
def start():
|
||||
return Reddit()
|
||||
|
||||
config = []
|
||||
17
couchpotato/core/providers/userscript/reddit/main.py
Normal file
17
couchpotato/core/providers/userscript/reddit/main.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from couchpotato import fireEvent
|
||||
from couchpotato.core.helpers.variable import splitString
|
||||
from couchpotato.core.providers.userscript.base import UserscriptBase
|
||||
|
||||
|
||||
class Reddit(UserscriptBase):
|
||||
|
||||
includes = ['*://www.reddit.com/r/Ijustwatched/comments/*']
|
||||
|
||||
def getMovie(self, url):
|
||||
name = splitString(url, '/')[-1]
|
||||
if name.startswith('ijw_'):
|
||||
name = name[4:]
|
||||
|
||||
year_name = fireEvent('scanner.name_year', name, single = True)
|
||||
|
||||
return self.search(year_name.get('name'), year_name.get('year'))
|
||||
Reference in New Issue
Block a user