Example #1
0
 def _file_path(self, template, episode):
     relative_path = template.format(
         name=episode.series.canonical_name,
         formatted=self._format_name(episode.series.canonical_name),
         season=episode.season.number,
         episode=episode.number,
         ext='*',
     )
     return first_valid(self._path.glob(relative_path))
Example #2
0
 def _file_path(self, template, movie):
     relative_path = template.format(title=movie.title, ext='*')
     return first_valid(self._path.glob(relative_path))
Example #3
0
 def movie_subtitle_path(self, movie):
     results = [c.subtitle_path(movie) for c in self._movie_collections]
     return first_valid(results)
Example #4
0
 def episode_subtitle_path(self, episode):
     results = [c.subtitle_path(episode) for c in self._episode_collections]
     return first_valid(results)
Example #5
0
 def movie(self, title, **kw):
     return first_valid(self.movies(title=title, **kw))
Example #6
0
 def season(self, series, number):
     return first_valid(self.seasons(series=series, numbers=[number]))
Example #7
0
 def episode(self, series, season, number, **kw):
     return first_valid(
         self.episodes(series=series, season=season, numbers=[number],
                       **kw))