Reworked Models to use tmdb to enable integration with Radarr api. Also reworked test connection to use api to validate as I ran into CORS errors. I also set up an endpoint to call radarr to delete movies. Currently only got to retrieving movie info. Should be able to use the id retrieved to then delete the movie.

This commit is contained in:
2026-03-07 18:02:45 -07:00
parent 958c581280
commit 3f5074aa3b
7 changed files with 276 additions and 70 deletions

View File

@@ -84,7 +84,7 @@ public sealed class StaleMediaScanner
foreach (SeriesInfo seriesInfo in staleSeriesInfo.Cast<SeriesInfo>())
{
_loggingHelper.LogInformation("Series Info: ID: {Id} | Series Name: {SeriesName} | Stale Seasons: {Seasons}", [seriesInfo.Id, seriesInfo.Name, string.Join(", ", seriesInfo.Seasons)]);
_loggingHelper.LogInformation("Series Info: TmbdID: {Id} | Series Name: {SeriesName} | Stale Seasons: {Seasons}", [seriesInfo.TmdbId, seriesInfo.Name, string.Join(", ", seriesInfo.Seasons)]);
}
}
else
@@ -99,15 +99,18 @@ public sealed class StaleMediaScanner
if (staleMovies.Count > 0)
{
staleMoviesInfo = staleMovies.Select(movie => new MovieInfo
{
Id = movie.Id,
Name = movie.Name
staleMoviesInfo = staleMovies.Select(movie => {
movie.ProviderIds.TryGetValue("Tmdb", out string? tmdbId);
return new MovieInfo
{
TmdbId = tmdbId,
Name = movie.Name
};
});
foreach (MovieInfo movieInfo in staleMoviesInfo.Cast<MovieInfo>())
{
_loggingHelper.LogInformation("Movie Info: ID: {Id} | Movie Name: {MovieName}", [movieInfo.Id, movieInfo.Name]);
_loggingHelper.LogInformation("Movie Info: TmdbID: {Id} | Movie Name: {MovieName}", [movieInfo.TmdbId, movieInfo.Name]);
}
}
else
@@ -231,9 +234,11 @@ public sealed class StaleMediaScanner
IEnumerable<SeriesInfo> seriesInfoList = series.Select(series =>
{
series.ProviderIds.TryGetValue("Tmdb", out string? tmdbId);
return new SeriesInfo
{
Id = series.Id,
SeriesId = series.Id,
TmdbId = tmdbId,
Name = series.Name,
Seasons = [.. seasons.Where(season => season.ParentId == series.Id).Select(season => season.Name)]
};