def get_Movie(self, vlc, movie=None): try: duration = int(self.cache['vlc_file_length']) if movie is None: now_playing = parse_movie(self.cache['vlc_file_name']) title = now_playing['title'] year = now_playing['year'] self.log.debug("get_Movie::Now playing: %s" % str(now_playing)) if self.valid_Movie(title, year, duration): movie = self.cache["movie_info"] self.log.debug("get_Movie::Valid movie found: %s" % str(movie)) if movie is not None: playtime = int(self.vlcTime) percentage = playtime * 100 / duration return self.set_video( False, movie['Title'], movie['Year'], movie['imdbID'], duration, percentage) return except: self.log.info("No matching movie found for video playing") self.log.debug("get_Movie::Here's to help debug", exc_info=sys.exc_info()) return
def get_Movie(self, vlc, movie=None): try: duration = int(self.cache['vlc_file_length']) if movie is None: now_playing = parse_movie(self.cache['vlc_file_name']) title = now_playing['title'] year = now_playing['year'] self.log.debug("get_Movie::Now playing: %s" % str(now_playing)) if self.valid_Movie(self.cache['vlc_file_path'], title, year, duration): movie = self.cache["movie_info"] self.log.debug("get_Movie::Valid movie found: %s" % str(movie)) if movie is not None: playtime = int(self.vlcTime) percentage = playtime * 100 / duration return self.set_video( False, movie['Title'], movie['Year'], movie['imdbID'], duration, percentage) return except: self.log.info("No matching movie found for video playing") self.log.debug("get_Movie::Here's to help debug", exc_info=sys.exc_info()) return
def _filenameparser_parse_movie_test(self, expected, string): parsed = filenameparser.parse_movie(string) self.assertEqual(expected, parsed)