add to library from search popup
This commit is contained in:
1 parent
2b2cc44851
commit
9d89eda74c
3 files changed
+79
-26
No files matched your search
@@ -17,12 +17,14 @@ export class LibraryService implements OnInit {
|
||||
private backend_apiUrl = environment.API_URL;
|
||||
private apiAction = 'entries';
|
||||
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.fetchAllEntries();
|
||||
constructor(private http: HttpClient) {
|
||||
this.fetchAllEntries().subscribe(() => {
|
||||
console.log(`Library Service: Loaded ${this.entries.length} entry.`);
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
getAllEntries(forceFetch: boolean = false): Observable<Entry[]> {
|
||||
if (!forceFetch && this.entriesLoaded) {
|
||||
return of(this.entries);
|
||||
@@ -169,6 +171,7 @@ export class LibraryService implements OnInit {
|
||||
// );
|
||||
// }
|
||||
public isInLibrary(tmdb_id: string): Observable<Entry | null> {
|
||||
console.log(`is in library called`);
|
||||
const existingEntry = this.entries.find(
|
||||
(entry) => entry.entryId.tmdb_id == tmdb_id
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user