mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-16 02:02:53 -07:00
Ouch. Almost lost these :(
This commit is contained in:
parent
608a0f1eaa
commit
cd470ae1ad
10 changed files with 1303 additions and 0 deletions
35
autoProcess/nzbToMediaSceneExceptions.py
Normal file
35
autoProcess/nzbToMediaSceneExceptions.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
# 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