mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-16 02:02:53 -07:00
replace .cbz and .cbr with .zip and .rar. fixes #351
This commit is contained in:
parent
39bf06f358
commit
0c8ce3917b
3 changed files with 9 additions and 4 deletions
|
@ -125,7 +125,10 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
|
||||||
for inputFile in inputFiles:
|
for inputFile in inputFiles:
|
||||||
filePath = os.path.dirname(inputFile)
|
filePath = os.path.dirname(inputFile)
|
||||||
fileName, fileExt = os.path.splitext(os.path.basename(inputFile))
|
fileName, fileExt = os.path.splitext(os.path.basename(inputFile))
|
||||||
fullFileName = os.path.basename(inputFile)
|
if fileExt in nzbtomedia.EXT_REPLACE:
|
||||||
|
fullFileName = fileName + nzbtomedia.EXT_REPLACE[fileExt]
|
||||||
|
else:
|
||||||
|
fullFileName = os.path.basename(inputFile)
|
||||||
|
|
||||||
targetFile = nzbtomedia.os.path.join(outputDestination, fullFileName)
|
targetFile = nzbtomedia.os.path.join(outputDestination, fullFileName)
|
||||||
if inputCategory in nzbtomedia.NOFLATTEN:
|
if inputCategory in nzbtomedia.NOFLATTEN:
|
||||||
|
|
|
@ -104,6 +104,7 @@ DELUGEPWD = None
|
||||||
|
|
||||||
EXTCONTAINER = []
|
EXTCONTAINER = []
|
||||||
COMPRESSEDCONTAINER = []
|
COMPRESSEDCONTAINER = []
|
||||||
|
EXT_REPLACE = {}
|
||||||
MEDIACONTAINER = []
|
MEDIACONTAINER = []
|
||||||
AUDIOCONTAINER = []
|
AUDIOCONTAINER = []
|
||||||
METACONTAINER = []
|
METACONTAINER = []
|
||||||
|
@ -156,7 +157,7 @@ def initialize(section=None):
|
||||||
OUTPUTVIDEOBITRATE, OUTPUTAUDIOCODEC, OUTPUTAUDIOBITRATE, OUTPUTSUBTITLECODEC, OUTPUTFASTSTART, OUTPUTQUALITYPERCENT, \
|
OUTPUTVIDEOBITRATE, OUTPUTAUDIOCODEC, OUTPUTAUDIOBITRATE, OUTPUTSUBTITLECODEC, OUTPUTFASTSTART, OUTPUTQUALITYPERCENT, \
|
||||||
NICENESS, LOG_DEBUG, FORCE_CLEAN, FFMPEG_PATH, FFMPEG, FFPROBE, AUDIOCONTAINER, EXTCONTAINER, TORRENT_CLASS, \
|
NICENESS, LOG_DEBUG, FORCE_CLEAN, FFMPEG_PATH, FFMPEG, FFPROBE, AUDIOCONTAINER, EXTCONTAINER, TORRENT_CLASS, \
|
||||||
DELETE_ORIGINAL, PASSWORDSFILE, USER_DELAY, USER_SCRIPT, USER_SCRIPT_CLEAN, USER_SCRIPT_MEDIAEXTENSIONS, \
|
DELETE_ORIGINAL, PASSWORDSFILE, USER_DELAY, USER_SCRIPT, USER_SCRIPT_CLEAN, USER_SCRIPT_MEDIAEXTENSIONS, \
|
||||||
USER_SCRIPT_PARAM, USER_SCRIPT_RUNONCE, USER_SCRIPT_SUCCESSCODES, DOWNLOADINFO
|
USER_SCRIPT_PARAM, USER_SCRIPT_RUNONCE, USER_SCRIPT_SUCCESSCODES, DOWNLOADINFO, EXT_REPLACE
|
||||||
|
|
||||||
if __INITIALIZED__:
|
if __INITIALIZED__:
|
||||||
return False
|
return False
|
||||||
|
@ -277,6 +278,7 @@ def initialize(section=None):
|
||||||
re.compile('.part\d+.rar$', re.I),
|
re.compile('.part\d+.rar$', re.I),
|
||||||
re.compile('.rar$', re.I)]
|
re.compile('.rar$', re.I)]
|
||||||
COMPRESSEDCONTAINER += [re.compile('%s$' % ext, re.I) for ext in CFG["Extensions"]["compressedExtensions"]]
|
COMPRESSEDCONTAINER += [re.compile('%s$' % ext, re.I) for ext in CFG["Extensions"]["compressedExtensions"]]
|
||||||
|
EXT_REPLACE = {'.cbr':'.rar', '.cbz':'.zip'} # extensions used for comic books need to be replaced before we can extract.
|
||||||
MEDIACONTAINER = CFG["Extensions"]["mediaExtensions"]
|
MEDIACONTAINER = CFG["Extensions"]["mediaExtensions"]
|
||||||
AUDIOCONTAINER = CFG["Extensions"]["audioExtensions"]
|
AUDIOCONTAINER = CFG["Extensions"]["audioExtensions"]
|
||||||
METACONTAINER = CFG["Extensions"]["metaExtensions"] # .nfo,.sub,.srt
|
METACONTAINER = CFG["Extensions"]["metaExtensions"] # .nfo,.sub,.srt
|
||||||
|
|
|
@ -771,7 +771,7 @@ def backupVersionedFile(old_file, version):
|
||||||
|
|
||||||
|
|
||||||
def update_downloadInfoStatus(inputName, status):
|
def update_downloadInfoStatus(inputName, status):
|
||||||
logger.debug("Updating status of our download %s in the DB to %s" % (inputName, status))
|
logger.db("Updating status of our download %s in the DB to %s" % (inputName, status))
|
||||||
|
|
||||||
myDB = nzbToMediaDB.DBConnection()
|
myDB = nzbToMediaDB.DBConnection()
|
||||||
myDB.action("UPDATE downloads SET status=?, last_update=? WHERE input_name=?",
|
myDB.action("UPDATE downloads SET status=?, last_update=? WHERE input_name=?",
|
||||||
|
@ -779,7 +779,7 @@ def update_downloadInfoStatus(inputName, status):
|
||||||
|
|
||||||
|
|
||||||
def get_downloadInfo(inputName, status):
|
def get_downloadInfo(inputName, status):
|
||||||
logger.debug("Getting download info for %s from the DB" % (inputName))
|
logger.db("Getting download info for %s from the DB" % (inputName))
|
||||||
|
|
||||||
myDB = nzbToMediaDB.DBConnection()
|
myDB = nzbToMediaDB.DBConnection()
|
||||||
sqlResults = myDB.select("SELECT * FROM downloads WHERE input_name=? AND status=?",
|
sqlResults = myDB.select("SELECT * FROM downloads WHERE input_name=? AND status=?",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue