merge config, model and process
This commit is contained in:
commit
81fb149f75
|
@ -2,8 +2,8 @@
|
||||||
# Configuration file
|
# Configuration file
|
||||||
|
|
||||||
### Defines the folder to watch and the destination folder
|
### Defines the folder to watch and the destination folder
|
||||||
ROOT_FOLDER = r'/home/fred/Videos/Series'
|
ROOT_FOLDER = r'/home/<username>/Videos/Series'
|
||||||
DL_FOLDER = r'/home/fred/Téléchargements/complete'
|
DL_FOLDER = r'/home/<username>/Downloads/complete'
|
||||||
|
|
||||||
### If a folder only contains these types of files, we can delete it.
|
### If a folder only contains these types of files, we can delete it.
|
||||||
useless_files_extensions = ('srr', 'nfo', 'sfv', 'nzb')
|
useless_files_extensions = ('srr', 'nfo', 'sfv', 'nzb')
|
||||||
|
@ -16,4 +16,3 @@ shows_dict = {
|
||||||
'wc' : 'white collar',
|
'wc' : 'white collar',
|
||||||
'tbbt' : 'the big bang theory',
|
'tbbt' : 'the big bang theory',
|
||||||
'beingerica' : 'being erica',
|
'beingerica' : 'being erica',
|
||||||
}
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ class Show(object):
|
||||||
|
|
||||||
self.path = path
|
self.path = path
|
||||||
self.name = os.path.basename(path)
|
self.name = os.path.basename(path)
|
||||||
|
|
||||||
|
|
||||||
def directory(self):
|
def directory(self):
|
||||||
return os.path.dirname(self.path)
|
return os.path.dirname(self.path)
|
||||||
|
|
|
@ -39,6 +39,7 @@ class PigeonHole(object):
|
||||||
for filename in files:
|
for filename in files:
|
||||||
if not filename.endswith(extensions):
|
if not filename.endswith(extensions):
|
||||||
print "%s doesn't end with %s" % (filename, extensions)
|
print "%s doesn't end with %s" % (filename, extensions)
|
||||||
|
|
||||||
yield os.path.join(root, filename)
|
yield os.path.join(root, filename)
|
||||||
|
|
||||||
def process(self):
|
def process(self):
|
||||||
|
@ -60,6 +61,7 @@ class PigeonHole(object):
|
||||||
|
|
||||||
if destinationfile is not None:
|
if destinationfile is not None:
|
||||||
self.move(show.path, destinationfile)
|
self.move(show.path, destinationfile)
|
||||||
|
|
||||||
self.movedFiles.append(destinationfile)
|
self.movedFiles.append(destinationfile)
|
||||||
|
|
||||||
if self.isDeletable(show.directory()):
|
if self.isDeletable(show.directory()):
|
||||||
|
@ -83,6 +85,7 @@ class PigeonHole(object):
|
||||||
for s in self.series:
|
for s in self.series:
|
||||||
if s.name.lower() in result:
|
if s.name.lower() in result:
|
||||||
print "Association found %s %s" % (s.directory, show.name)
|
print "Association found %s %s" % (s.directory, show.name)
|
||||||
|
|
||||||
return os.path.join(s.directory, show.name)
|
return os.path.join(s.directory, show.name)
|
||||||
|
|
||||||
|
|
||||||
|
@ -101,6 +104,7 @@ class PigeonHole(object):
|
||||||
|
|
||||||
print "Foldername value is %s" % (foldername)
|
print "Foldername value is %s" % (foldername)
|
||||||
|
|
||||||
|
|
||||||
if foldername == self.downloadDir or foldername == self.rootShows:
|
if foldername == self.downloadDir or foldername == self.rootShows:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -132,3 +136,4 @@ if __name__ == "__main__":
|
||||||
pHole.getSubtitles()
|
pHole.getSubtitles()
|
||||||
#pHole.structure.writeUrls()
|
#pHole.structure.writeUrls()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue