Rebuild playouts with modified collections (#39)
* rebuild playouts when items are removed from collections * rebuild playouts when items are added to collections * simplify logic
This commit is contained in:
@@ -8,13 +8,14 @@ namespace ErsatzTV.Core.Interfaces.Repositories
|
||||
public interface IMediaCollectionRepository
|
||||
{
|
||||
Task<Collection> Add(Collection collection);
|
||||
Task<Unit> AddMediaItem(int collectionId, int mediaItemId);
|
||||
Task<bool> AddMediaItem(int collectionId, int mediaItemId);
|
||||
Task<Option<Collection>> Get(int id);
|
||||
Task<Option<Collection>> GetCollectionWithItems(int id);
|
||||
Task<Option<Collection>> GetCollectionWithItemsUntracked(int id);
|
||||
Task<List<Collection>> GetAll();
|
||||
Task<Option<List<MediaItem>>> GetItems(int id);
|
||||
Task Update(Collection collection);
|
||||
Task<bool> Update(Collection collection);
|
||||
Task Delete(int collectionId);
|
||||
Task<List<int>> PlayoutIdsUsingCollection(int collectionId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,15 +62,18 @@ namespace ErsatzTV.Core.Iptv
|
||||
|
||||
string title = playoutItem.MediaItem switch
|
||||
{
|
||||
Movie m => m.MovieMetadata.HeadOrNone().Map(mm => mm.Title ?? string.Empty).IfNone("[unknown movie]"),
|
||||
Episode e => e.EpisodeMetadata.HeadOrNone().Map(em => em.Title ?? string.Empty).IfNone("[unknown episode]"),
|
||||
Movie m => m.MovieMetadata.HeadOrNone().Map(mm => mm.Title ?? string.Empty)
|
||||
.IfNone("[unknown movie]"),
|
||||
Episode e => e.EpisodeMetadata.HeadOrNone().Map(em => em.Title ?? string.Empty)
|
||||
.IfNone("[unknown episode]"),
|
||||
_ => "[unknown]"
|
||||
};
|
||||
|
||||
string description = playoutItem.MediaItem switch
|
||||
{
|
||||
Movie m => m.MovieMetadata.HeadOrNone().Map(mm => mm.Plot ?? string.Empty).IfNone(string.Empty),
|
||||
Episode e => e.EpisodeMetadata.HeadOrNone().Map(em => em.Plot ?? string.Empty).IfNone(string.Empty),
|
||||
Episode e => e.EpisodeMetadata.HeadOrNone().Map(em => em.Plot ?? string.Empty)
|
||||
.IfNone(string.Empty),
|
||||
_ => string.Empty
|
||||
};
|
||||
|
||||
@@ -108,7 +111,7 @@ namespace ErsatzTV.Core.Iptv
|
||||
xml.WriteAttributeString("system", "onscreen");
|
||||
xml.WriteString($"S{s:00}E{e:00}");
|
||||
xml.WriteEndElement(); // episode-num
|
||||
|
||||
|
||||
xml.WriteStartElement("episode-num");
|
||||
xml.WriteAttributeString("system", "xmltv_ns");
|
||||
xml.WriteString($"{s - 1}.{e - 1}.0/1");
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace ErsatzTV.Core.Metadata
|
||||
|
||||
return fileName != null ? GetMovieMetadata(fileName, metadata) : metadata;
|
||||
}
|
||||
|
||||
|
||||
public string GetSortTitle(string title)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(title))
|
||||
|
||||
Reference in New Issue
Block a user