Beispiel #1
0
 def skip_movie(self, wanted_item_index, title, year):
     if not wanted_item_index:
         raise cherrypy.HTTPError(400, 'No wanted_item index supplied')
     if not title:
         raise cherrypy.HTTPError(400, 'No title supplied')
     movie = title
     if year:
         movie += ' (' + year + ')'
     # Check if already skipped
     movie_sanitized = sanitize(movie)
     for x in autosubliminal.SKIPMOVIE:
         if movie_sanitized == sanitize(x):
             send_websocket_notification('Already skipped movie %s.' %
                                         movie)
             redirect('/home')
     # Skip movie
     if subchecker.skip_movie(wanted_item_index):
         config.write_config_property('skipmovie', movie, '00')
         config.apply_skipmovie()
         send_websocket_notification('Skipped movie %s.' % movie)
     else:
         send_websocket_notification(
             'Could not skip movie! Please check the log file!',
             type='error')
     redirect('/home')
Beispiel #2
0
    def flush_library(self):
        if not autosubliminal.SCANLIBRARY.running:
            ShowDetailsDb().flush_shows(episodes=True, subtitles=True)
            MovieDetailsDb().flush_movies(subtitles=True)
            send_websocket_notification('Flushed library database.')
        else:
            send_websocket_notification('Cannot flush library database when library scanner is running!',
                                        type='notice')

        redirect('/library')
Beispiel #3
0
 def post_process(self, wanted_item_index, subtitle_index=None):
     # Post process
     if subtitle_index:
         processed = subchecker.post_process(wanted_item_index, subtitle_index)
         if processed:
             return {'result': processed, 'infomessage:': None, 'errormessage': None, 'redirect': '/home'}
         else:
             return {'result': processed, 'infomessage': None,
                     'errormessage': 'Unable to handle post processing! Please check the log file!'}
     else:
         subchecker.post_process_no_subtitle(wanted_item_index)
         redirect('/home')
Beispiel #4
0
 def flush_wanted_items(self):
     if get_wanted_queue_lock():
         # Flush db and wanted queue
         WantedItemsDb().flush_wanted_items()
         autosubliminal.WANTEDQUEUE = []
         release_wanted_queue_lock()
         send_websocket_notification(
             'Flushed wanted items database. Please launch \'Scan Disk\' from the \'System\' menu.')
     else:
         send_websocket_notification('Cannot flush wanted items database when wanted queue is in use!',
                                     type='notice')
     redirect('/home')
Beispiel #5
0
 def delete_video(self, wanted_item_index, confirmed=False, cleanup=False):
     if not confirmed:
         wanted_item = autosubliminal.WANTEDQUEUE[int(wanted_item_index)]
         video = wanted_item.videopath
         return PageTemplate('/home/home-deletevideo.mako').render(wanted_item_index=wanted_item_index, video=video)
     else:
         # Delete video
         deleted = subchecker.delete_video(wanted_item_index, cleanup)
         if deleted:
             send_websocket_notification('Video deleted from filesystem.')
         else:
             send_websocket_notification('Video could not be deleted! Please check the log file!', type='error')
         redirect('/home')
Beispiel #6
0
 def delete_video(self, wanted_item_index, confirmed=False, cleanup=False):
     if not confirmed:
         wanted_item = autosubliminal.WANTEDQUEUE[int(wanted_item_index)]
         video = wanted_item.videopath
         return PageTemplate('/home/home-deletevideo.mako').render(
             wanted_item_index=wanted_item_index, video=video)
     else:
         # Delete video
         deleted = subchecker.delete_video(wanted_item_index, cleanup)
         if deleted:
             send_websocket_notification('Video deleted from filesystem.')
         else:
             send_websocket_notification(
                 'Video could not be deleted! Please check the log file!',
                 type='error')
         redirect('/home')
Beispiel #7
0
    def skip_show(self, wanted_item_index, title, season=None):
        if not season:
            return PageTemplate('/home/home-skipshow.mako').render(
                wanted_item_index=wanted_item_index, title=title)
        else:
            if not wanted_item_index:
                raise cherrypy.HTTPError(400, 'No wanted_item index supplied')
            if not title:
                raise cherrypy.HTTPError(400, 'No show supplied')
            # Check if season is a number to be sure
            if not season == '00':
                season = text_type(int(season))
            config_season = season
            # Check if already skipped
            title_sanitized = sanitize(title)
            for x in autosubliminal.SKIPSHOW:
                if title_sanitized == sanitize(x):
                    for s in autosubliminal.SKIPSHOW[x].split(','):
                        if s == season or s == '00':
                            send_websocket_notification(
                                'Already skipped show %s season %s.' %
                                (title, season))
                            redirect('/home')
                    # Not skipped yet, skip all or append season the seasons to skip
                    if season == '00':
                        config_season = '00'
                    else:
                        seasons = autosubliminal.SKIPSHOW[x].split(',')
                        seasons.append(season)
                        config_season = ','.join(sorted(seasons))
            # Skip show
            if subchecker.skip_show(wanted_item_index, season):
                config.write_config_property('skipshow', title, config_season)
                config.apply_skipshow()
                if season == '00':
                    send_websocket_notification(
                        'Skipped show %s all seasons.' % title)
                else:
                    send_websocket_notification('Skipped show %s season %s.' %
                                                (title, season))
            else:
                send_websocket_notification(
                    'Could not skip show! Please check the log file!',
                    type='error')

            redirect('/home')
Beispiel #8
0
    def skip_show(self, wanted_item_index, title, season=None):
        if not season:
            return PageTemplate('/home/home-skipshow.mako').render(wanted_item_index=wanted_item_index, title=title)
        else:
            if not wanted_item_index:
                raise cherrypy.HTTPError(400, 'No wanted_item index supplied')
            if not title:
                raise cherrypy.HTTPError(400, 'No show supplied')
            # Check if season is a number to be sure
            if not season == '00':
                season = text_type(int(season))
            config_season = season
            # Check if already skipped
            title_sanitized = sanitize(title)
            for x in autosubliminal.SKIPSHOW:
                if title_sanitized == sanitize(x):
                    for s in autosubliminal.SKIPSHOW[x].split(','):
                        if s == season or s == '00':
                            send_websocket_notification('Already skipped show %s season %s.' % (title, season))
                            redirect('/home')
                    # Not skipped yet, skip all or append season the seasons to skip
                    if season == '00':
                        config_season = '00'
                    else:
                        seasons = autosubliminal.SKIPSHOW[x].split(',')
                        seasons.append(season)
                        config_season = ','.join(sorted(seasons))
            # Skip show
            if subchecker.skip_show(wanted_item_index, season):
                config.write_config_property('skipshow', title, config_season)
                config.apply_skipshow()
                if season == '00':
                    send_websocket_notification('Skipped show %s all seasons.' % title)
                else:
                    send_websocket_notification('Skipped show %s season %s.' % (title, season))
            else:
                send_websocket_notification('Could not skip show! Please check the log file!', type='error')

            redirect('/home')
Beispiel #9
0
 def skip_movie(self, wanted_item_index, title, year):
     if not wanted_item_index:
         raise cherrypy.HTTPError(400, 'No wanted_item index supplied')
     if not title:
         raise cherrypy.HTTPError(400, 'No title supplied')
     movie = title
     if year:
         movie += ' (' + year + ')'
     # Check if already skipped
     movie_sanitized = sanitize(movie)
     for x in autosubliminal.SKIPMOVIE:
         if movie_sanitized == sanitize(x):
             send_websocket_notification('Already skipped movie %s.' % movie)
             redirect('/home')
     # Skip movie
     if subchecker.skip_movie(wanted_item_index):
         config.write_config_property('skipmovie', movie, '00')
         config.apply_skipmovie()
         send_websocket_notification('Skipped movie %s.' % movie)
     else:
         send_websocket_notification('Could not skip movie! Please check the log file!', type='error')
     redirect('/home')
Beispiel #10
0
 def post_process(self, wanted_item_index, subtitle_index=None):
     # Post process
     if subtitle_index:
         processed = subchecker.post_process(wanted_item_index,
                                             subtitle_index)
         if processed:
             return {
                 'result': processed,
                 'infomessage:': None,
                 'errormessage': None,
                 'redirect': '/home'
             }
         else:
             return {
                 'result':
                 processed,
                 'infomessage':
                 None,
                 'errormessage':
                 'Unable to handle post processing! Please check the log file!'
             }
     else:
         subchecker.post_process_no_subtitle(wanted_item_index)
         redirect('/home')
Beispiel #11
0
 def flush_last_downloads(self):
     LastDownloadsDb().flush_last_downloads()
     send_websocket_notification('Flushed last downloads database.')
     redirect('/home')
Beispiel #12
0
 def force_id_search(self, wanted_item_index):
     subchecker.force_id_search(wanted_item_index)
     redirect('/home')
Beispiel #13
0
 def force_id_search(self, wanted_item_index):
     subchecker.force_id_search(wanted_item_index)
     redirect('/home')
Beispiel #14
0
 def index(self):
     redirect('/home')
Beispiel #15
0
 def index(self):
     redirect('/log/viewLog')
Beispiel #16
0
 def index(self):
     # Redirect to general settings by default
     redirect('/config/general')
Beispiel #17
0
 def flush_cache(self):
     TvdbIdCacheDb().flush_tvdb_ids()
     ImdbIdCacheDb().flush_imdb_ids()
     send_websocket_notification('Flushed id cache database.')
     redirect('/home')
Beispiel #18
0
 def index(self):
     redirect('/log/viewLog')
Beispiel #19
0
 def index(self):
     # Redirect to overview by default
     return redirect('/library/shows')
Beispiel #20
0
 def index(self):
     # Redirect to general settings by default
     redirect('/config/general')
Beispiel #21
0
 def index(self):
     return redirect('/system/info')