mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-13 18:16:52 -07:00
Major overhaul of nzbToMedia code base plus a whole restrucure
This commit is contained in:
parent
e7751b96c5
commit
85d8739512
67 changed files with 1687 additions and 1734 deletions
|
@ -1,35 +0,0 @@
|
|||
# System imports
|
||||
import os
|
||||
import logging
|
||||
|
||||
# Custom imports
|
||||
from nzbToMediaUtil import iterate_media_files
|
||||
|
||||
|
||||
Logger = logging.getLogger()
|
||||
|
||||
|
||||
def process_all_exceptions(name, dirname):
|
||||
for group, exception in __customgroups__.items():
|
||||
if not (group in name or group in dirname):
|
||||
continue
|
||||
process_exception(exception, name, dirname)
|
||||
|
||||
|
||||
def process_exception(exception, name, dirname):
|
||||
for parentDir, filename in iterate_media_files(dirname):
|
||||
exception(filename, parentDir)
|
||||
|
||||
|
||||
def process_qoq(filename, dirname):
|
||||
Logger.debug("Reversing the file name for a QoQ release %s", filename)
|
||||
head, fileExtension = os.path.splitext(os.path.basename(filename))
|
||||
newname = head[::-1]
|
||||
newfile = newname + fileExtension
|
||||
newfilePath = os.path.join(dirname, newfile)
|
||||
os.rename(filename, newfilePath)
|
||||
Logger.debug("New file name is %s", newfile)
|
||||
|
||||
# dict for custom groups
|
||||
# we can add more to this list
|
||||
__customgroups__ = {'Q o Q': process_qoq}
|
Loading…
Add table
Add a link
Reference in a new issue