diff --git a/couchpotato/core/media/movie/searcher/main.py b/couchpotato/core/media/movie/searcher/main.py index 8a13cb4..dfc2ee2 100644 --- a/couchpotato/core/media/movie/searcher/main.py +++ b/couchpotato/core/media/movie/searcher/main.py @@ -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 diff --git a/couchpotato/core/providers/userscript/reddit/__init__.py b/couchpotato/core/providers/userscript/reddit/__init__.py new file mode 100644 index 0000000..a74bbf0 --- /dev/null +++ b/couchpotato/core/providers/userscript/reddit/__init__.py @@ -0,0 +1,7 @@ +from .main import Reddit + + +def start(): + return Reddit() + +config = [] diff --git a/couchpotato/core/providers/userscript/reddit/main.py b/couchpotato/core/providers/userscript/reddit/main.py new file mode 100644 index 0000000..9790f6e --- /dev/null +++ b/couchpotato/core/providers/userscript/reddit/main.py @@ -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'))