Browse Source

Fix excluded directory not working

master
djib 2 years ago
parent
commit
0ff1f73039
  1. 14
      FreeboxMoviePlanner.py

14
FreeboxMoviePlanner.py

@ -136,7 +136,7 @@ class TVGuideScraper:
class FreeboxMoviePlanner:
def __init__(self, movies, excluded_channels=[], excluded_directory=False):
def __init__(self, movies, excluded_channels=[], excluded_directory=[]):
logging.debug('Opening config file: config.json')
with open('config.json') as config_file:
self.config = json.load(config_file)
@ -157,8 +157,8 @@ class FreeboxMoviePlanner:
self.excludeTelevisionFilm()
self.findMoviesOnTMDB()
self.excludeBadRatings()
if self.excluded_directory:
self.excludeLocalMovies()
for directory in self.excluded_directory:
self.excludeLocalMovies(directory)
self.askForUserSelection()
self.excludeNotSelected()
self.programMovies()
@ -276,9 +276,11 @@ class FreeboxMoviePlanner:
m for m in self.movies if not m.genre.startswith("Téléfilm")
]
def excludeLocalMovies(self):
(_, _, filenames) = next(os.walk('.'))
logging.info('Dropping movies already recorded: {}'.format(
def excludeLocalMovies(self, directory):
(_, _, filenames) = next(os.walk(directory))
for f in filenames:
print(f)
logging.warning('Dropping movies already recorded: {}'.format(
[ m for m in self.movies if m.title+'.m2ts' in filenames ]
))
self.movies = [

Loading…
Cancel
Save