mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -07:00
fix(music): 🐛 Fixed not able to request individual albums
This commit is contained in:
parent
91fc48c7d8
commit
cb884b00da
2 changed files with 19 additions and 7 deletions
|
@ -3,8 +3,6 @@ import { IDiscoverCardResult } from "../../interfaces";
|
||||||
import { RequestType } from "../../../interfaces";
|
import { RequestType } from "../../../interfaces";
|
||||||
import { MessageService, RequestService, SearchV2Service } from "../../../services";
|
import { MessageService, RequestService, SearchV2Service } from "../../../services";
|
||||||
import { MatDialog } from "@angular/material/dialog";
|
import { MatDialog } from "@angular/material/dialog";
|
||||||
import { IArtistRequestModel } from "../../../interfaces/IRequestModel";
|
|
||||||
import { IReleaseGroups } from "../../../interfaces/IMusicSearchResultV2";
|
|
||||||
import { ISearchTvResultV2 } from "../../../interfaces/ISearchTvResultV2";
|
import { ISearchTvResultV2 } from "../../../interfaces/ISearchTvResultV2";
|
||||||
import { ISearchMovieResultV2 } from "../../../interfaces/ISearchMovieResultV2";
|
import { ISearchMovieResultV2 } from "../../../interfaces/ISearchMovieResultV2";
|
||||||
import { EpisodeRequestComponent } from "../../../shared/episode-request/episode-request.component";
|
import { EpisodeRequestComponent } from "../../../shared/episode-request/episode-request.component";
|
||||||
|
@ -31,7 +29,6 @@ export class DiscoverCardComponent implements OnInit {
|
||||||
|
|
||||||
// This data is needed to open the dialog
|
// This data is needed to open the dialog
|
||||||
private tvSearchResult: ISearchTvResultV2;
|
private tvSearchResult: ISearchTvResultV2;
|
||||||
private allAlbums: IReleaseGroups[] = [];
|
|
||||||
|
|
||||||
constructor(private searchService: SearchV2Service, private dialog: MatDialog, private requestService: RequestService,
|
constructor(private searchService: SearchV2Service, private dialog: MatDialog, private requestService: RequestService,
|
||||||
public messageService: MessageService) { }
|
public messageService: MessageService) { }
|
||||||
|
@ -68,7 +65,6 @@ export class DiscoverCardComponent implements OnInit {
|
||||||
this.searchService.getReleaseGroupArt(this.result.id.toString()).subscribe(art => {
|
this.searchService.getReleaseGroupArt(this.result.id.toString()).subscribe(art => {
|
||||||
if (art.image) {
|
if (art.image) {
|
||||||
this.result.posterPath = art.image;
|
this.result.posterPath = art.image;
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -112,7 +108,7 @@ export class DiscoverCardComponent implements OnInit {
|
||||||
return `/details/tv/${this.result.id}`;
|
return `/details/tv/${this.result.id}`;
|
||||||
case RequestType.artist: //Actually artist
|
case RequestType.artist: //Actually artist
|
||||||
return `/details/artist/${this.result.id}`;
|
return `/details/artist/${this.result.id}`;
|
||||||
case RequestType.album: //Actually artist
|
case RequestType.album:
|
||||||
return `/details/album/${this.result.id}`;
|
return `/details/album/${this.result.id}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,8 +152,18 @@ export class DiscoverCardComponent implements OnInit {
|
||||||
this.messageService.send(x.errorMessage, "Ok");
|
this.messageService.send(x.errorMessage, "Ok");
|
||||||
}
|
}
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});;
|
});
|
||||||
return;
|
return;
|
||||||
|
case RequestType.album:
|
||||||
|
this.requestService.requestAlbum({foreignAlbumId: this.result.id.toString(), monitor: 'all', monitored: true, searchForMissingAlbums: false}).subscribe(x => {
|
||||||
|
if (x.result) {
|
||||||
|
this.result.requested = true;
|
||||||
|
this.messageService.send(x.message, "Ok");
|
||||||
|
} else {
|
||||||
|
this.messageService.send(x.errorMessage, "Ok");
|
||||||
|
}
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
case RequestType.tvShow:
|
case RequestType.tvShow:
|
||||||
const dia = this.dialog.open(EpisodeRequestComponent, { width: "700px", data: { series: this.tvSearchResult, isAdmin: this.isAdmin }, panelClass: 'modal-panel' });
|
const dia = this.dialog.open(EpisodeRequestComponent, { width: "700px", data: { series: this.tvSearchResult, isAdmin: this.isAdmin }, panelClass: 'modal-panel' });
|
||||||
dia.afterClosed().subscribe(x => this.loading = false);
|
dia.afterClosed().subscribe(x => this.loading = false);
|
||||||
|
|
|
@ -103,10 +103,13 @@ export class DiscoverSearchResultsComponent implements OnInit {
|
||||||
if (mediaType === RequestType.tvShow) {
|
if (mediaType === RequestType.tvShow) {
|
||||||
poster = "images/default_tv_poster.png"
|
poster = "images/default_tv_poster.png"
|
||||||
}
|
}
|
||||||
|
if (mediaType === RequestType.album || mediaType === RequestType.artist) {
|
||||||
|
poster = "images/default-music-placeholder.png";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.discoverResults.push({
|
this.discoverResults.push({
|
||||||
posterPath: mediaType !== RequestType.artist && mediaType !== RequestType.album ? poster : "images/default-music-placeholder.png",
|
posterPath: poster,
|
||||||
requested: false,
|
requested: false,
|
||||||
title: m.title,
|
title: m.title,
|
||||||
type: mediaType,
|
type: mediaType,
|
||||||
|
@ -158,6 +161,9 @@ export class DiscoverSearchResultsComponent implements OnInit {
|
||||||
if (mediaType === RequestType.tvShow) {
|
if (mediaType === RequestType.tvShow) {
|
||||||
poster = "images/default_tv_poster.png"
|
poster = "images/default_tv_poster.png"
|
||||||
}
|
}
|
||||||
|
if (mediaType === RequestType.album || mediaType === RequestType.artist) {
|
||||||
|
poster = "images/default-music-placeholder.png";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.discoverResults.push({
|
this.discoverResults.push({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue