diff --git a/frontend/src/app/core/components/search-popup-entry-line/search-popup-entry-line.component.css b/frontend/src/app/core/components/search-popup-entry-line/search-popup-entry-line.component.css
new file mode 100644
index 0000000..e69de29
diff --git a/frontend/src/app/core/components/search-popup-entry-line/search-popup-entry-line.component.html b/frontend/src/app/core/components/search-popup-entry-line/search-popup-entry-line.component.html
new file mode 100644
index 0000000..f0f5f63
--- /dev/null
+++ b/frontend/src/app/core/components/search-popup-entry-line/search-popup-entry-line.component.html
@@ -0,0 +1,26 @@
+
+
+
![]()
+
+
+
+
{{ entry.title }}
+
+
+ {{ entry.release_date | dateFormat }}
+
+
+
+ {{ entry.seasons.length }} Seasons
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/app/core/components/search-popup-entry-line/search-popup-entry-line.component.spec.ts b/frontend/src/app/core/components/search-popup-entry-line/search-popup-entry-line.component.spec.ts
new file mode 100644
index 0000000..4ce47df
--- /dev/null
+++ b/frontend/src/app/core/components/search-popup-entry-line/search-popup-entry-line.component.spec.ts
@@ -0,0 +1,28 @@
+/* tslint:disable:no-unused-variable */
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { By } from '@angular/platform-browser';
+import { DebugElement } from '@angular/core';
+
+import { SearchPopupEntryLineComponent } from './search-popup-entry-line.component';
+
+describe('SearchPopupEntryLineComponent', () => {
+ let component: SearchPopupEntryLineComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ SearchPopupEntryLineComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SearchPopupEntryLineComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/frontend/src/app/core/components/search-popup-entry-line/search-popup-entry-line.component.ts b/frontend/src/app/core/components/search-popup-entry-line/search-popup-entry-line.component.ts
new file mode 100644
index 0000000..84d658e
--- /dev/null
+++ b/frontend/src/app/core/components/search-popup-entry-line/search-popup-entry-line.component.ts
@@ -0,0 +1,76 @@
+import { Component, Input, input, OnInit } from '@angular/core';
+import { Entry } from '../../../shared/models/entry.model';
+import { LibraryService } from '../../services/library.service';
+import { Router } from '@angular/router';
+
+@Component({
+ selector: 'app-search-popup-entry-line',
+ templateUrl: './search-popup-entry-line.component.html',
+ styleUrls: ['./search-popup-entry-line.component.css'],
+})
+export class SearchPopupEntryLineComponent implements OnInit {
+ @Input() entry!: Entry;
+ isAddLocked: boolean = false;
+
+ constructor(private libraryService: LibraryService, private router: Router) {}
+
+ ngOnInit() {
+ if (!this.entry.isInLibrary) {
+ this.libraryService.isInLibrary(this.entry.entryId.tmdb_id).subscribe({
+ next: (e) => {
+ if (e != null) {
+ e.isInLibrary = true;
+ this.entry = e;
+ }
+ },
+ error: (error) => {},
+ });
+ }
+ }
+
+ lineClick() {
+ this.libraryService.isInLibrary(this.entry.entryId.tmdb_id).subscribe({
+ next: (e) => {
+ if (e != null) {
+ this.router.navigate([`/entries/${e.id}`]);
+ } else {
+ let type = this.entry.is_tvseries ? 'tv' : 'movie';
+ window.open(
+ `https://www.themoviedb.org/${type}/` + this.entry.entryId.tmdb_id,
+ '_blank'
+ );
+ }
+ },
+ error: (error) => {},
+ });
+ }
+
+ addToLibrary() {
+ this.isAddLocked = true;
+ this.entry.isLocked = true;
+ const tmdbId = this.entry.entryId.tmdb_id;
+ const isTvSerie = this.entry.is_tvseries;
+ let obs = this.libraryService.addEntry(tmdbId, isTvSerie).subscribe({
+ next: (entry) => {
+ if (entry != null) {
+ entry.isInLibrary = true;
+ this.libraryService.refetchEntries().subscribe();
+ // this.searchedEntries.forEach((e) => {
+ // if (e.entryId.tmdb_id == entry.entryId.tmdb_id) {
+ // e.isInLibrary = true;
+ // }
+ // });
+ this.isAddLocked = false;
+ entry.isLocked = false;
+ obs.unsubscribe();
+ }
+ },
+ error: (error) => {
+ // TODO error notification
+ console.error('Error adding entry:', error);
+ this.isAddLocked = false;
+ obs.unsubscribe();
+ },
+ });
+ }
+}
diff --git a/frontend/src/app/core/components/search-popup/search-popup.component.html b/frontend/src/app/core/components/search-popup/search-popup.component.html
index 00f199c..57f20df 100644
--- a/frontend/src/app/core/components/search-popup/search-popup.component.html
+++ b/frontend/src/app/core/components/search-popup/search-popup.component.html
@@ -23,33 +23,8 @@
Movies & Tv-Series
-
-
-
![]()
-
-
-
-
{{ entry.title }}
-
-
- {{ entry.release_date | dateFormat }}
-
-
-
- {{ entry.seasons.length }} Seasons
-
-
-
-
-
-
+
@@ -57,8 +32,6 @@
Please search for movies and TV series.
-
-