Merge branch 'master' of https://github.com/X4Lo/Showy
This commit is contained in:
commit
710ebcc934
82 files changed
+1422
-386
No files matched your search
@@ -580,19 +580,19 @@
|
||||
</div>
|
||||
</a>
|
||||
<hr class="dropdown-divider">
|
||||
<a class="dropdown-item d-flex align-items-center gap-2 py-2" href="javascript:;"><i
|
||||
class="material-icons-outlined">person_outline</i>Profile</a>
|
||||
<a class="dropdown-item d-flex align-items-center gap-2 py-2" href="javascript:;"><i
|
||||
class="material-icons-outlined">local_bar</i>Setting</a>
|
||||
<a class="dropdown-item d-flex align-items-center gap-2 py-2" href="javascript:;"><i
|
||||
class="material-icons-outlined">dashboard</i>Dashboard</a>
|
||||
<a class="dropdown-item d-flex align-items-center gap-2 py-2" href="javascript:;"><i
|
||||
class="material-icons-outlined">account_balance</i>Earning</a>
|
||||
<a class="dropdown-item d-flex align-items-center gap-2 py-2" href="javascript:;"><i
|
||||
class="material-icons-outlined">cloud_download</i>Downloads</a>
|
||||
<a class="dropdown-item d-flex align-items-center gap-2 py-2" href="javascript:;">
|
||||
<i class="material-icons-outlined">person_outline</i>Profile</a>
|
||||
<a class="dropdown-item d-flex align-items-center gap-2 py-2" href="javascript:;">
|
||||
<i class="material-icons-outlined">local_bar</i>Setting</a>
|
||||
<a class="dropdown-item d-flex align-items-center gap-2 py-2" href="javascript:;">
|
||||
<i class="material-icons-outlined">dashboard</i>Dashboard</a>
|
||||
<a class="dropdown-item d-flex align-items-center gap-2 py-2" href="javascript:;">
|
||||
<i class="material-icons-outlined">account_balance</i>Earning</a>
|
||||
<a class="dropdown-item d-flex align-items-center gap-2 py-2" href="javascript:;">
|
||||
<i class="material-icons-outlined">cloud_download</i>Downloads</a>
|
||||
<hr class="dropdown-divider">
|
||||
<a class="dropdown-item d-flex align-items-center gap-2 py-2" href="javascript:;"><i
|
||||
class="material-icons-outlined">power_settings_new</i>Logout</a>
|
||||
<a class="dropdown-item d-flex align-items-center gap-2 py-2" href="javascript:;">
|
||||
<i class="material-icons-outlined">power_settings_new</i>Logout</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -8,7 +8,8 @@ a {
|
||||
}
|
||||
|
||||
.sidebar-wrapper .sidebar-header .logo-img {
|
||||
width: 48px;
|
||||
height: 40px;
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
.sidebar-wrapper .sidebar-header,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<img src="assets/images/logo3.png" class="logo-img" alt="">
|
||||
</div>
|
||||
<div class="logo-name flex-grow-1">
|
||||
<h5 class="mb-0">ShowzY</h5>
|
||||
<h5 class="mb-0">Showy</h5>
|
||||
</div>
|
||||
<!-- <div class="sidebar-close">
|
||||
<span class="material-icons-outlined">close</span>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { EntrySeen } from '../../shared/models/entrySeen.model';
|
||||
import { EntryRating } from '../../shared/models/entryRating.model';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class EntryRatingsService {
|
||||
private backend_apiUrl = 'http://localhost:4000/api/v1';
|
||||
private backend_apiUrl = environment.API_URL;
|
||||
private apiAction = 'entry-ratings';
|
||||
|
||||
constructor(private http: HttpClient) {}
|
||||
@@ -16,7 +16,7 @@ export class EntryRatingsService {
|
||||
return this.http.put<EntryRating>(
|
||||
`${this.backend_apiUrl}/${this.apiAction}/${entryRatings.id}`,
|
||||
{
|
||||
entryR: entryRatings
|
||||
entryR: entryRatings,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { EntrySeen } from '../../shared/models/entrySeen.model';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class EntrySeenService {
|
||||
private backend_apiUrl = 'http://localhost:4000/api/v1';
|
||||
private backend_apiUrl = environment.API_URL;
|
||||
private apiAction = 'entry-seen';
|
||||
|
||||
constructor(private http: HttpClient) {}
|
||||
@@ -22,6 +23,16 @@ export class EntrySeenService {
|
||||
);
|
||||
}
|
||||
|
||||
updateEntrySeen(entrySeen: EntrySeen) {
|
||||
return this.http.put<EntrySeen>(
|
||||
`${this.backend_apiUrl}/${this.apiAction}/${entrySeen.id}`,
|
||||
{
|
||||
date_seen: entrySeen.date_seen,
|
||||
seen_with: entrySeen.seen_with,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// get entry seen by entry id
|
||||
getEntrySeenById(id: string) {
|
||||
return this.http.get<EntrySeen[]>(
|
||||
|
||||
@@ -4,13 +4,13 @@ import { Observable, map } from 'rxjs';
|
||||
import { Entry } from '../../shared/models/entry.model';
|
||||
import { EntryId } from '../../shared/models/entryId.model';
|
||||
import { EntryRating } from '../../shared/models/entryRating.model';
|
||||
// import { environment } from '../../../environments/environment';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class EntryService {
|
||||
private backend_apiUrl = 'http://localhost:4000/api/v1';
|
||||
private backend_apiUrl = environment.API_URL;
|
||||
private apiAction = 'entries';
|
||||
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
@@ -2,12 +2,13 @@ import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { EpisodeSeen } from '../../shared/models/episodeSeen.model';
|
||||
import { EpisodeSeenDto } from '../../shared/models/dtos/episode-seen.dto';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class EpisodeSeenService {
|
||||
private backend_apiUrl = 'http://localhost:4000/api/v1';
|
||||
private backend_apiUrl = environment.API_URL;
|
||||
private apiAction = 'episode-seen';
|
||||
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class EpisodeService {
|
||||
private backend_apiUrl = 'http://localhost:4000/api/v1';
|
||||
private backend_apiUrl = environment.API_URL;
|
||||
private apiAction = 'episodes';
|
||||
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
@@ -2,12 +2,13 @@ import { Injectable } from '@angular/core';
|
||||
import { MovieDateSeen } from '../../shared/models/dtos/movieDateSeen.model';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Entry } from '../../shared/models/entry.model';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ImporterService {
|
||||
private backend_apiUrl = 'http://localhost:4000/api/v1';
|
||||
private backend_apiUrl = environment.API_URL;
|
||||
private apiAction = 'entries';
|
||||
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { catchError, switchMap, tap } from 'rxjs/operators';
|
||||
import { Entry } from '../../shared/models/entry.model';
|
||||
import { EntryId } from '../../shared/models/entryId.model';
|
||||
import { EntryRating } from '../../shared/models/entryRating.model';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@@ -13,7 +14,8 @@ export class LibraryService implements OnInit {
|
||||
private libraryEntriesSubject = new ReplaySubject<Entry[]>(1);
|
||||
private entriesLoaded = false;
|
||||
|
||||
private backend_apiUrl = ' http://localhost:4000/api/v1';
|
||||
private backend_apiUrl = environment.API_URL;
|
||||
private apiAction = 'entries';
|
||||
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
@@ -48,7 +50,7 @@ export class LibraryService implements OnInit {
|
||||
}
|
||||
|
||||
private fetchAllEntries(forceFetch: boolean = false): Observable<Entry[]> {
|
||||
const endPoint = `${this.backend_apiUrl}/entries`;
|
||||
const endPoint = `${this.backend_apiUrl}/${this.apiAction}`;
|
||||
|
||||
// If data is already loaded and not force fetching, immediately return the cached observable.
|
||||
if (this.entriesLoaded && !forceFetch) {
|
||||
@@ -80,10 +82,13 @@ export class LibraryService implements OnInit {
|
||||
if (existingEntry) {
|
||||
return of(existingEntry);
|
||||
} else {
|
||||
return this.http.post<Entry>(`${this.backend_apiUrl}/entries`, {
|
||||
tmdb_id: tmdb_id,
|
||||
is_tvserie: is_tvserie,
|
||||
});
|
||||
return this.http.post<Entry>(
|
||||
`${this.backend_apiUrl}/${this.apiAction}`,
|
||||
{
|
||||
tmdb_id: tmdb_id,
|
||||
is_tvserie: is_tvserie,
|
||||
}
|
||||
);
|
||||
}
|
||||
})
|
||||
);
|
||||
@@ -91,7 +96,7 @@ export class LibraryService implements OnInit {
|
||||
|
||||
deleteEntry(id: number): Observable<any> {
|
||||
// Directly attempt to delete the entry without fetching all entries first.
|
||||
return this.http.delete(`${this.backend_apiUrl}/entries/${id}`);
|
||||
return this.http.delete(`${this.backend_apiUrl}/${this.apiAction}/${id}`);
|
||||
}
|
||||
|
||||
isInLibrary(tmdb_id: string): Observable<Entry | null> {
|
||||
|
||||
@@ -2,12 +2,13 @@ import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Season } from '../../shared/models/season.model';
|
||||
import { Episode } from '../../shared/models/episode.models';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class SeasonService {
|
||||
private backend_apiUrl = 'http://localhost:4000/api/v1';
|
||||
private backend_apiUrl = environment.API_URL;
|
||||
private apiAction = 'seasons';
|
||||
|
||||
constructor(private http: HttpClient) {}
|
||||
@@ -31,4 +32,10 @@ export class SeasonService {
|
||||
`${this.backend_apiUrl}/${this.apiAction}/${id}/episodes`
|
||||
);
|
||||
}
|
||||
|
||||
getSeasonsWithEpisodesByEntryId(entryId: number) {
|
||||
return this.http.get<Season[]>(
|
||||
`${this.backend_apiUrl}/entries/${entryId}/seasons`
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
import { Settings } from '../../shared/models/settings.model';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class SettingsService {
|
||||
private backend_apiUrl = environment.API_URL;
|
||||
private apiAction = 'settings';
|
||||
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
getSettings() {
|
||||
return this.http.get<Settings>(`${this.backend_apiUrl}/${this.apiAction}`);
|
||||
}
|
||||
|
||||
updateSettings(settings: Settings) {
|
||||
return this.http.put<any>(
|
||||
`${this.backend_apiUrl}/${this.apiAction}`,
|
||||
settings
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import { Observable, from, map, of, switchMap, toArray } from 'rxjs';
|
||||
import { Entry } from '../../shared/models/entry.model';
|
||||
import { EntryId } from '../../shared/models/entryId.model';
|
||||
import { EntryRating } from '../../shared/models/entryRating.model';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@@ -14,8 +15,8 @@ export class TmdbService {
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
// private apiUrl = environment.apiBaseUrl;
|
||||
private tmdb_apiUrl = 'https://api.themoviedb.org/3';
|
||||
private tmdb_apiKey = '5323ef3dc430df54dcb9e58c37fd22bb';
|
||||
private tmdb_apiUrl = environment.TMDB_API_URL;
|
||||
private tmdb_apiKey = environment.TMDB_API_KEY;
|
||||
|
||||
fetchdata(endPoint: string): Observable<any> {
|
||||
if (this.cach[endPoint]) {
|
||||
@@ -34,9 +35,6 @@ export class TmdbService {
|
||||
|
||||
getEntriesUsingEndPoint(endPoint: string): Observable<Entry[]> {
|
||||
return this.fetchdata(endPoint).pipe(
|
||||
// map((response) =>
|
||||
// response.results.map((movie: any) => this.adaptMovieToEntry(movie))
|
||||
// )
|
||||
map((response) => {
|
||||
// Check if the data is from cache and has `exist` property
|
||||
if (response.exist) {
|
||||
|
||||
@@ -4,12 +4,13 @@ import { Observable } from 'rxjs';
|
||||
import { UserCollection } from '../../shared/models/userCollection.model';
|
||||
import { UserCollectionEntry } from '../../shared/models/userCollectionEntry.model';
|
||||
import { Entry } from '../../shared/models/entry.model';
|
||||
import { environment } from '../../../environments/environment.prod';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class UserCollectionService {
|
||||
private backend_apiUrl = 'http://localhost:4000/api/v1';
|
||||
private backend_apiUrl = environment.API_URL;
|
||||
private apiAction = 'user-collections';
|
||||
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
Reference in new issue
Block a user