public static void LoadEpisodes(Series series) { if (series != null) { (series.Episodes = GetEpisodes(series.Id)).ForEach(a => a.Series = series); } }
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); } }
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); } }
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); }