示例#1
0
 public static void LoadEpisodes(Series series)
 {
     if (series != null)
     {
         (series.Episodes = GetEpisodes(series.Id)).ForEach(a => a.Series = series);
     }
 }
示例#2
0
 public static void SaveSeries(Series series)
 {
     series.UpdatedDate = DateTime.Now;
     
     using (var db = DatabaseFactory.GetMetaDbConnection())
     {
         if (series.Id != null)
             db.Execute("delete from series where id = ?", series.Id);
         db.Insert(series);
     }
 }
示例#3
0
 public void HandleSeries(Recording record, Series series)
 {
     //Create NFO
     xbmc.DeleteSeriesNfoFile(new FileInfo(record.Filename).DirectoryName);
     if (series == null)
     {
         xbmc.CreateSeriesNfoFile(record.Name, true);
     }
     else if (!string.Equals(record.Name, series.SeriesName, StringComparison.OrdinalIgnoreCase))
     {
         xbmc.CreateSeriesNfoFile(record.Name, series.Id, true);
     }
 }
示例#4
0
        public void Rename(Recording record, Series series, Episode episode)
        {
            FileUtil.CreateDirectoryPath(xbmc.GetSeriesDirectory(record.Name));
            
            //Cleanup orphaned files
            if (!File.Exists(record.Filename))
            {
                xbmc.DeleteVideoNfoFile(record.Filename);
                return;
            }

            HandleSeries(record, series);
            HandleEpisode(record, episode);
        }