mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 13:23:18 -07:00
Fixed issues in the nzbTo* scripts with manual runs not properly sending the categories to be processed.
Fixed issue in TorrentToMedia with noFlatten variable for HeadPhones. Changed name of function get_categories to get_sections in nzbToMediaUtil. Added code in get_dirnames to properly return back the directory could not find anything to process in.
This commit is contained in:
parent
2791139c6b
commit
c3410fba8f
10 changed files with 70 additions and 72 deletions
|
@ -14,6 +14,7 @@ from nzbtomedia.nzbToMediaUtil import getDirectorySize, convert_to_ascii
|
|||
Logger = logging.getLogger()
|
||||
|
||||
class autoProcessMovie:
|
||||
|
||||
def get_imdb(self, nzbName, dirName):
|
||||
imdbid = ""
|
||||
|
||||
|
@ -41,18 +42,18 @@ class autoProcessMovie:
|
|||
|
||||
def get_movie_info(self, baseURL, imdbid, download_id):
|
||||
|
||||
movie_id = ""
|
||||
movie_id = None
|
||||
movie_status = None
|
||||
release_status = None
|
||||
if not imdbid and not download_id:
|
||||
return movie_id, imdbid, download_id, movie_status, release_status
|
||||
|
||||
releaselist = []
|
||||
movieid = []
|
||||
moviestatus = []
|
||||
library = []
|
||||
release = []
|
||||
offset = int(0)
|
||||
release_status = None
|
||||
|
||||
if not imdbid and not download_id:
|
||||
return movie_id, imdbid, download_id, movie_status, release_status
|
||||
|
||||
while True:
|
||||
url = baseURL + "media.list/?status=active&release_status=snatched&limit_offset=50," + str(offset)
|
||||
|
||||
|
@ -64,10 +65,7 @@ class autoProcessMovie:
|
|||
Logger.exception("Unable to open URL")
|
||||
break
|
||||
|
||||
movieid2 = []
|
||||
library2 = []
|
||||
release2 = []
|
||||
moviestatus2 = []
|
||||
try:
|
||||
result = r.json()
|
||||
movieid2 = [item["_id"] for item in result["movies"]]
|
||||
|
@ -78,7 +76,7 @@ class autoProcessMovie:
|
|||
library2.append(item["identifiers"]["imdb"])
|
||||
release2 = [item["releases"] for item in result["movies"]]
|
||||
moviestatus2 = [item["status"] for item in result["movies"]]
|
||||
except:
|
||||
except Exception, e:
|
||||
Logger.exception("Unable to parse json data for movies")
|
||||
break
|
||||
|
||||
|
@ -86,11 +84,11 @@ class autoProcessMovie:
|
|||
moviestatus.extend(moviestatus2)
|
||||
library.extend(library2)
|
||||
release.extend(release2)
|
||||
|
||||
if len(movieid2) < int(50): # finished parsing list of movies. Time to break.
|
||||
break
|
||||
offset = offset + 50
|
||||
|
||||
result = None # reset
|
||||
for index in range(len(movieid)):
|
||||
releaselist1 = [item for item in release[index] if item["status"] == "snatched" and "download_info" in item]
|
||||
if download_id:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue