sort numbers & build the season string in the frontend (#306)
This commit is contained in:
parent
f83a32e7dd
commit
eaee1ac842
@ -1032,7 +1032,7 @@
|
|||||||
|
|
||||||
// add all seasons from this show to the season select
|
// add all seasons from this show to the season select
|
||||||
for (const season in shows[selectShow.value].Seasons) {
|
for (const season in shows[selectShow.value].Seasons) {
|
||||||
addItem(selectSeason, shows[selectShow.value].Seasons[season], season);
|
addItem(selectSeason, "Season " + shows[selectShow.value].Seasons[season], season);
|
||||||
}
|
}
|
||||||
|
|
||||||
selectSeason.value = "";
|
selectSeason.value = "";
|
||||||
|
@ -44,14 +44,14 @@ public class VisualizationController(ILogger<VisualizationController> logger) :
|
|||||||
var seriesId = first.SeriesId;
|
var seriesId = first.SeriesId;
|
||||||
var seasonId = kvp.Key;
|
var seasonId = kvp.Key;
|
||||||
|
|
||||||
var seasonName = GetSeasonName(first);
|
var seasonNumber = first.SeasonNumber;
|
||||||
if (!showSeasons.TryGetValue(seriesId, out var showInfo))
|
if (!showSeasons.TryGetValue(seriesId, out var showInfo))
|
||||||
{
|
{
|
||||||
showInfo = new ShowInfos { SeriesName = first.SeriesName, ProductionYear = GetProductionYear(seriesId), LibraryName = GetLibraryName(seriesId), Seasons = [] };
|
showInfo = new ShowInfos { SeriesName = first.SeriesName, ProductionYear = GetProductionYear(seriesId), LibraryName = GetLibraryName(seriesId), Seasons = [] };
|
||||||
showSeasons[seriesId] = showInfo;
|
showSeasons[seriesId] = showInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
showInfo.Seasons[seasonId] = seasonName;
|
showInfo.Seasons[seasonId] = seasonNumber;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,11 +288,6 @@ public class VisualizationController(ILogger<VisualizationController> logger) :
|
|||||||
return NoContent();
|
return NoContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetSeasonName(QueuedEpisode episode)
|
|
||||||
{
|
|
||||||
return "Season " + episode.SeasonNumber.ToString(CultureInfo.InvariantCulture);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string GetProductionYear(Guid seriesId)
|
private static string GetProductionYear(Guid seriesId)
|
||||||
{
|
{
|
||||||
return seriesId == Guid.Empty
|
return seriesId == Guid.Empty
|
||||||
|
@ -26,6 +26,6 @@ namespace ConfusedPolarBear.Plugin.IntroSkipper.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the Seasons of the show.
|
/// Gets the Seasons of the show.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public required Dictionary<Guid, string> Seasons { get; init; }
|
public required Dictionary<Guid, int> Seasons { get; init; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user