diff --git a/CHANGELOG.md b/CHANGELOG.md index ebab3a80e..c3c4636af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [4.45.1](https://github.com/Ombi-app/Ombi/compare/v4.45.0...v4.45.1) (2024-08-20) + + +### Bug Fixes + +* **plex:** Fixed some errors around the scanner that was causing the scan to fail ([d9787dc](https://github.com/Ombi-app/Ombi/commit/d9787dc32aace808d196f6f87456ef45de3d7bbf)) + + + # [4.45.0](https://github.com/Ombi-app/Ombi/compare/v4.44.1...v4.45.0) (2024-08-07) @@ -3717,12 +3726,3 @@ -# [4.37.0](https://github.com/Ombi-app/Ombi/compare/v4.36.1...v4.37.0) (2023-04-24) - - -### Features - -* Search by genre ([1837419](https://github.com/Ombi-app/Ombi/commit/18374198f9f2462ba85c5781b0fcc05892728b21)) - - - diff --git a/src/Ombi.Schedule/Jobs/Ombi/RefreshMetadata.cs b/src/Ombi.Schedule/Jobs/Ombi/RefreshMetadata.cs index d7c05d71e..adf6bddca 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/RefreshMetadata.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/RefreshMetadata.cs @@ -7,6 +7,7 @@ using Microsoft.Extensions.Logging; using Ombi.Api.Emby; using Ombi.Api.Jellyfin; using Ombi.Api.Plex; +using Ombi.Api.Plex.Models; using Ombi.Api.TheMovieDb; using Ombi.Api.TheMovieDb.Models; using Ombi.Api.TvMaze; @@ -286,7 +287,18 @@ namespace Ombi.Schedule.Jobs.Ombi continue; } var servers = settings.Servers[0]; - var metaData = await _plexApi.GetMetadata(servers.PlexAuthToken, settings.Servers[0].FullUri, movie.Key); + PlexMetadata metaData = null; + + try + { + metaData = await _plexApi.GetMetadata(servers.PlexAuthToken, settings.Servers[0].FullUri, movie.Key); + } + catch (Exception e) + { + _log.LogError($"Could not find the metadata for title: '{movie.Title}', skipping"); + _log.LogDebug(e, $"Could not find the metadata for title: '{movie.Title}', skipping"); + continue; + } var guids = new List(); var meta = metaData.MediaContainer.Metadata.FirstOrDefault(); diff --git a/src/Ombi.Schedule/Jobs/Plex/PlexContentSync.cs b/src/Ombi.Schedule/Jobs/Plex/PlexContentSync.cs index 365110d9c..596a6202a 100644 --- a/src/Ombi.Schedule/Jobs/Plex/PlexContentSync.cs +++ b/src/Ombi.Schedule/Jobs/Plex/PlexContentSync.cs @@ -304,6 +304,13 @@ namespace Ombi.Schedule.Jobs.Plex var existing = await Repo.GetFirstContentByCustom(x => x.Title == movie.title && x.ReleaseYear == movie.year.ToString() && x.Type == MediaType.Movie); + + + if (existing == null) + { + // Let's just check the key + existing = await Repo.GetByKey(movie.ratingKey); + } if (existing != null) { // We need to see if this is a different quality, @@ -340,13 +347,7 @@ namespace Ombi.Schedule.Jobs.Plex Logger.LogDebug($"We already have movie {movie.title}"); continue; - } - - //var hasSameKey = await Repo.GetByKey(movie.ratingKey); - //if (hasSameKey != null) - //{ - // await Repo.Delete(hasSameKey); - //} + } Logger.LogDebug("Adding movie {0}", movie.title); var guids = new List(); diff --git a/src/Ombi.Store/Ombi.Store.csproj b/src/Ombi.Store/Ombi.Store.csproj index 7ab9f5b91..ca12ab3f2 100644 --- a/src/Ombi.Store/Ombi.Store.csproj +++ b/src/Ombi.Store/Ombi.Store.csproj @@ -19,7 +19,7 @@ - + diff --git a/src/Ombi.Store/Repository/PlexContentRepository.cs b/src/Ombi.Store/Repository/PlexContentRepository.cs index 9f34af6a1..1d9a35cd4 100644 --- a/src/Ombi.Store/Repository/PlexContentRepository.cs +++ b/src/Ombi.Store/Repository/PlexContentRepository.cs @@ -94,7 +94,7 @@ namespace Ombi.Store.Repository public async Task GetByKey(string key) { - return await Db.PlexServerContent.Include(x => x.Seasons).FirstOrDefaultAsync(x => x.Key == key); + return await Db.PlexServerContent.Include(x => x.Seasons).Include(x => x.Episodes).FirstOrDefaultAsync(x => x.Key == key); } public IEnumerable GetWhereContentByCustom(Expression> predicate) diff --git a/src/Ombi/ClientApp/package.json b/src/Ombi/ClientApp/package.json index cf6d2991a..a32db3e08 100644 --- a/src/Ombi/ClientApp/package.json +++ b/src/Ombi/ClientApp/package.json @@ -29,7 +29,7 @@ "@fortawesome/fontawesome-free": "^6.6.0", "@microsoft/signalr": "^6.0.23", "@ngx-translate/core": "^15.0.0", - "@ngx-translate/http-loader": "^7.0.0", + "@ngx-translate/http-loader": "^8.0.0", "@ngxs/devtools-plugin": "3.8.2", "@ngxs/store": "3.8.2", "@types/jquery": "^3.5.30", diff --git a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.html b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.html index 5be2aa1ad..a1b3bc81b 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.html +++ b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.html @@ -5,9 +5,13 @@ {{'Discovery.Tv' | translate}} - +@defer (when discoverResults.length > 0) { - \ No newline at end of file + +} +@placeholder(minimum 500) { + +} \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.html b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.html index ff650d1dc..16a46c0d6 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.html +++ b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.html @@ -1,12 +1,7 @@
- @defer (on viewport; prefetch on idle) {

{{ 'Discovery.Genres' | translate }}

- } - @placeholder { - - }

{{ 'Discovery.RecentlyRequestedTab' | translate }}

diff --git a/src/Ombi/ClientApp/src/app/discover/components/genre/genre-button-select.component.html b/src/Ombi/ClientApp/src/app/discover/components/genre/genre-button-select.component.html index 688634dc7..71ee25709 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/genre/genre-button-select.component.html +++ b/src/Ombi/ClientApp/src/app/discover/components/genre/genre-button-select.component.html @@ -1,13 +1,26 @@ -
- - {{genre.name}} - -
-
- - {{genre.name}} - - -
\ No newline at end of file + +@defer (when movieGenreList()) { +
+ + {{genre.name}} + +
+} +@placeholder(minimum 500) { + +} + +@defer (when tvGenreList()) { +
+ + {{genre.name}} + +
+} +@placeholder(minimum 500) { + +} + + \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/genre/genre-button-select.component.ts b/src/Ombi/ClientApp/src/app/discover/components/genre/genre-button-select.component.ts index 4dbf7233c..a16ca06e7 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/genre/genre-button-select.component.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/genre/genre-button-select.component.ts @@ -1,10 +1,11 @@ -import { Component, OnInit } from "@angular/core"; +import { Component, OnInit, computed, signal } from "@angular/core"; import { SearchV2Service } from "../../../services"; import { MatButtonToggleChange } from "@angular/material/button-toggle"; import { RequestType } from "../../../interfaces"; import { AdvancedSearchDialogDataService } from "app/shared/advanced-search-dialog/advanced-search-dialog-data.service"; import { Router } from "@angular/router"; import { map, Observable } from "rxjs"; +import { toSignal } from '@angular/core/rxjs-interop'; interface IGenreSelect { name: string; @@ -17,8 +18,10 @@ interface IGenreSelect { styleUrls: ["./genre-button-select.component.scss"], }) export class GenreButtonSelectComponent implements OnInit { - public movieGenreList$: Observable = null; - public tvGenreList$: Observable = null; + + public movieGenreList = signal(null); + public tvGenreList = signal(null); + isLoading: boolean = false; @@ -27,8 +30,14 @@ export class GenreButtonSelectComponent implements OnInit { private router: Router) { } public ngOnInit(): void { - this.movieGenreList$ = this.searchService.getGenres("movie").pipe(map(x => x.slice(0, 10).map(y => ({ name: y.name, id: y.id, type: "movie" })))); - this.tvGenreList$ = this.searchService.getGenres("tv").pipe(map(x => x.slice(0, 10).map(y => ({ name: y.name, id: y.id, type: "tv" })))); + this.searchService.getGenres("movie").pipe(map(x => x.slice(0, 10).map(y => ({ name: y.name, id: y.id, type: "movie" } as IGenreSelect)))) + .subscribe(x => { + this.movieGenreList.set(x); + }); + this.searchService.getGenres("tv").pipe(map(x => x.slice(0, 10).map(y => ({ name: y.name, id: y.id, type: "tv" } as IGenreSelect)))) + .subscribe(x => { + this.tvGenreList.set(x); + }); } public async toggleChanged(event: MatButtonToggleChange, type: "movie"|"tv") { diff --git a/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.html b/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.html index 875e34542..6da28c744 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.html +++ b/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.html @@ -1,9 +1,8 @@ -
-
- + - @defer (on viewport; prefetch on idle) { - } - @placeholder { - - }
-
\ No newline at end of file +}@placeholder(minimum 500) { +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+} \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.scss b/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.scss index 81c559a83..01c68db4d 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.scss +++ b/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.scss @@ -109,4 +109,8 @@ ::ng-deep .p-carousel-item{ flex: 1 0 200px !important; } +} + +.loading-container { + margin-left: 10rem; } \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.ts b/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.ts index d30b4b66d..ceba645de 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input, ViewChild, OnDestroy } from "@angular/core"; +import { Component, OnInit, Input, ViewChild, OnDestroy, signal } from "@angular/core"; import { IRecentlyRequested, IRequestEngineResult, RequestType } from "../../../interfaces"; import { Carousel } from 'primeng/carousel'; import { ResponsiveOptions } from "../carousel.options"; @@ -31,6 +31,7 @@ export class RecentlyRequestedListComponent implements OnInit, OnDestroy { @ViewChild('carousel', {static: false}) carousel: Carousel; public requests$: Observable; + public requests = signal(null); public responsiveOptions: any; public RequestType = RequestType; @@ -119,11 +120,13 @@ export class RecentlyRequestedListComponent implements OnInit, OnDestroy { } private loadData() { - this.requests$ = this.requestServiceV2.getRecentlyRequested().pipe( + this.requestServiceV2.getRecentlyRequested().pipe( tap(() => this.loading()), takeUntil(this.$loadSub), finalize(() => this.finishLoading()) - ); + ).subscribe(x => { + this.requests.set(x); + }); } private loading() { diff --git a/src/Ombi/ClientApp/yarn.lock b/src/Ombi/ClientApp/yarn.lock index 83fa3dc2a..ace79d921 100644 --- a/src/Ombi/ClientApp/yarn.lock +++ b/src/Ombi/ClientApp/yarn.lock @@ -2086,12 +2086,10 @@ resolved "https://registry.yarnpkg.com/@ngx-translate/core/-/core-15.0.0.tgz#0fe55b9bd47e75b03d1123658f15fb7b5a534f3c" integrity sha512-Am5uiuR0bOOxyoercDnAA3rJVizo4RRqJHo8N3RqJ+XfzVP/I845yEnMADykOHvM6HkVm4SZSnJBOiz0Anx5BA== -"@ngx-translate/http-loader@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@ngx-translate/http-loader/-/http-loader-7.0.0.tgz#905f38d8d13342621516635bf480ff9a4f73e9fc" - integrity sha512-j+NpXXlcGVdyUNyY/qsJrqqeAdJdizCd+GKh3usXExSqy1aE9866jlAIL+xrfDU4w+LiMoma5pgE4emvFebZmA== - dependencies: - tslib "^2.3.0" +"@ngx-translate/http-loader@^8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@ngx-translate/http-loader/-/http-loader-8.0.0.tgz#e02c25dbe33c6b1edee73e3654ab8a161572cdfb" + integrity sha512-SFMsdUcmHF5OdZkL1CHEoSAwbP5EbAOPTLLboOCRRoOg21P4GJx+51jxGdJeGve6LSKLf4Pay7BkTwmE6vxYlg== "@ngxs/devtools-plugin@3.8.2": version "3.8.2" diff --git a/version.json b/version.json index 104dad135..b2e92c831 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "4.45.0" + "version": "4.45.1" }