Exemplo n.º 1
0
def markSeen(cmd, args):

    episode = db.store.find(series_list.Episode,
                            series_list.Episode.id == args["id"]).one()
    if episode is not None:
        episode.status = series_list.EP_SEEN
        db.store.commit()

        viewmgr.episode_updated(episode)

        # auto archive all the files that the collection function finds to be
        # placed under the current episode season number small convenience for
        # the user instead of manually archiving them
        if len(episode.season) > 3:
            series = db.store.find(
                series_list.Series,
                series_list.Series.id == episode.series_id).one()
            if series is not None and series.folder != '' and appcfg.options[
                    appcfg.CFG_SERIES_PATH] != '':
                sfiles = db_conv_xml._collectEpisodeFiles(
                    series_list.get_series_path(series))
                if episode.season in sfiles:
                    for epobj in sfiles[episode.season]:
                        errstr = _archiveFile(epobj.filepath)
                        if errstr is not None:
                            cmd.html = errstr
                            return

        cmd.redirect = _getBaseURL("series?cmd_get_series=%i" %
                                   episode.series_id)
        cmd.html = ''
Exemplo n.º 2
0
def markSeen(cmd, args):

    episode = db.store.find(series_list.Episode, series_list.Episode.id == args["id"]).one()
    if episode is not None:
        episode.status = series_list.EP_SEEN
        db.store.commit()
        
        viewmgr.episode_updated(episode)

        # auto archive all the files that the collection function finds to be
        # placed under the current episode season number small convenience for
        # the user instead of manually archiving them
        if len(episode.season) > 3:
            series = db.store.find(series_list.Series, series_list.Series.id == episode.series_id).one()
            if series is not None and series.folder != '' and appcfg.options[appcfg.CFG_SERIES_PATH] != '':
                sfiles = db_conv_xml._collectEpisodeFiles(series_list.get_series_path(series))
                if episode.season in sfiles:
                    for epobj in sfiles[episode.season]:
                        errstr = _archiveFile(epobj.filepath)
                        if errstr is not None:
                            cmd.html = errstr
                            return

        cmd.redirect = _getBaseURL("series?cmd_get_series=%i" % episode.series_id)
        cmd.html = ''
Exemplo n.º 3
0
 def _onMarkEpisodes(self, event):
     st = menuhelper.getmenu(event.GetId())
     eps = viewmgr.get_selected_episodes()
     for episode in eps:
         episode.status = id_to_stat[st]
         episode.changed = 0
         episode.new = 0
         db.store.commit()
         viewmgr.episode_updated(episode)
Exemplo n.º 4
0
 def _onMarkEpisodes(self, event):
     st = menuhelper.getmenu(event.GetId())
     eps = viewmgr.get_selected_episodes()
     for episode in eps:
         episode.status = id_to_stat[st]
         episode.changed = 0
         episode.new = 0
         db.store.commit()
         viewmgr.episode_updated(episode)
Exemplo n.º 5
0
 def _onEditEpisode(self, msg):
     episode_id = msg.data
     episode = db.store.find(series_list.Episode, series_list.Episode.id == episode_id).one()
     if episode is not None:
         dlg = EpisodeEditDlg.EpisodeEditDlg(self)
         dlg.ObjectToGui(episode)            
         if dlg.ShowModal() == wx.ID_OK:
             dlg.GuiToObject(episode)
             db.store.commit()
             viewmgr.episode_updated(episode)
         dlg.Destroy()