F: season page, addd more episodes view modes + various fixes
This commit is contained in:
1 parent
8f0e9f44a5
commit
59f5d70f09
13 files changed
+464
-144
No files matched your search
@@ -9,11 +9,12 @@ const defaultSettings = {
|
|||||||
backPort: '',
|
backPort: '',
|
||||||
portableMode: '',
|
portableMode: '',
|
||||||
|
|
||||||
libraryViewMode: '',
|
libraryViewMode: 'grid',
|
||||||
favoritViewMode: '',
|
favoritViewMode: 'grid',
|
||||||
watchlistViewMode: '',
|
watchlistViewMode: 'grid',
|
||||||
CollectionsViewMode: '',
|
CollectionsViewMode: 'grid',
|
||||||
CollectionItemsViewMode: '',
|
CollectionItemsViewMode: 'grid',
|
||||||
|
episodesViewMode: 'grid'
|
||||||
};
|
};
|
||||||
|
|
||||||
class ConfigService {
|
class ConfigService {
|
||||||
@@ -39,7 +40,8 @@ class ConfigService {
|
|||||||
try {
|
try {
|
||||||
const settingsData = fs.readFileSync(settingsFilePath);
|
const settingsData = fs.readFileSync(settingsFilePath);
|
||||||
// console.log(`Loaded settings file.`);
|
// console.log(`Loaded settings file.`);
|
||||||
return JSON.parse(settingsData);
|
const parsedSettings = JSON.parse(settingsData);
|
||||||
|
return { ...defaultSettings, ...parsedSettings };
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Error reading settings file:', err);
|
console.error('Error reading settings file:', err);
|
||||||
console.log('Creating default settings file...');
|
console.log('Creating default settings file...');
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { EpisodeSeen } from '../../shared/models/episode-seen.model';
|
import { EpisodeSeen } from '../../shared/models/episode-seen.model';
|
||||||
import { EpisodeSeenDto } from '../../shared/models/dtos/episode-seen.dto';
|
import { EpisodeSeenCreateDto } from '../../shared/models/dtos/episode-seen.dto';
|
||||||
import { ConfigService } from './config.service';
|
import { ConfigService } from './config.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@@ -33,25 +33,25 @@ export class EpisodeSeenService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getEpisodeSeenByEntryId(entryId: number) {
|
getEpisodeSeenByEntryId(entryId: number) {
|
||||||
return this.http.get<any[]>(
|
return this.http.get<EpisodeSeen[]>(
|
||||||
`${this.backend_apiUrl}/${this.apiAction}/by-entry/${entryId}`
|
`${this.backend_apiUrl}/${this.apiAction}/by-entry/${entryId}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getEpisodeSeenBySeasonId(entryId: number) {
|
getEpisodeSeenBySeasonId(entryId: number) {
|
||||||
return this.http.get<any[]>(
|
return this.http.get<EpisodeSeen[]>(
|
||||||
`${this.backend_apiUrl}/${this.apiAction}/by-season/${entryId}`
|
`${this.backend_apiUrl}/${this.apiAction}/by-season/${entryId}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get episode-seen by episode Id
|
// get episode-seen by Id
|
||||||
getEpisodeSeenById(id: number) {
|
getEpisodeSeenById(id: number) {
|
||||||
return this.http.get<EpisodeSeen[]>(
|
return this.http.get<EpisodeSeen>(
|
||||||
`${this.backend_apiUrl}/${this.apiAction}/${id}`
|
`${this.backend_apiUrl}/${this.apiAction}/${id}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateEpisodeSeen(episodeSeen: EpisodeSeenDto) {
|
updateEpisodeSeen(episodeSeen: EpisodeSeenCreateDto) {
|
||||||
return this.http.put<any>(
|
return this.http.put<any>(
|
||||||
`${this.backend_apiUrl}/${this.apiAction}/${episodeSeen.id}`,
|
`${this.backend_apiUrl}/${this.apiAction}/${episodeSeen.id}`,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ h3 {
|
|||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-wrapper {
|
.content-wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
@@ -90,6 +91,14 @@ h3 {
|
|||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.less-more {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.less-more:hover {
|
||||||
|
color: var(--shz-blue-default);
|
||||||
|
}
|
||||||
|
|
||||||
.entry-actions .btn-icon-only-success {
|
.entry-actions .btn-icon-only-success {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
|||||||
@@ -155,7 +155,7 @@
|
|||||||
(episodeWatchedDeletedEvent)="triggerEpisodeWatchedDeletedEvent()">
|
(episodeWatchedDeletedEvent)="triggerEpisodeWatchedDeletedEvent()">
|
||||||
</app-season-main-card>
|
</app-season-main-card>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-center clickable" *ngIf="entry.seasons.length > initialCount"
|
<p class="text-center clickable less-more mt-3" *ngIf="entry.seasons.length > initialCount"
|
||||||
(click)="toggleShowAllSeasons()">
|
(click)="toggleShowAllSeasons()">
|
||||||
{{ showAll ? 'Show Less' : 'Show All' }}
|
{{ showAll ? 'Show Less' : 'Show All' }}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -115,6 +115,7 @@
|
|||||||
margin: 0 5px 3px 0;
|
margin: 0 5px 3px 0;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-icon-only:hover {
|
.btn-icon-only:hover {
|
||||||
color: #fc185a;
|
color: #fc185a;
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<button *ngIf="episodesWatchedCount < this.season.episode_count" type="button"
|
<button *ngIf="episodesWatchedCount < this.season.episode_count" type="button"
|
||||||
class="btn btn-outline-primary rounded-pill d-flex justify-content-center align-items-center"
|
class="btn btn-outline-primary rounded-pill d-flex justify-content-center align-items-center"
|
||||||
style="height: 30px; width: 40px; margin-right: 5px;" (click)="episodeMarkSeenClick()">
|
style="height: 30px; width: 40px; margin-right: 5px;" (click)="episodeMarkSeenClick($event)">
|
||||||
<span class="material-symbols-outlined">check</span>
|
<span class="material-symbols-outlined">check</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -82,7 +82,9 @@ export class SeasonMainCardComponent implements OnInit {
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
async episodeMarkSeenClick() {
|
async episodeMarkSeenClick(event: Event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
if (this.lockActions) return;
|
if (this.lockActions) return;
|
||||||
this.lockActions = true;
|
this.lockActions = true;
|
||||||
|
|
||||||
|
|||||||
@@ -98,17 +98,33 @@
|
|||||||
border-color: #007bff;
|
border-color: #007bff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.episode-metadata .card-text {
|
||||||
|
margin-bottom: 0;
|
||||||
|
padding-top: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ! List View */
|
||||||
.episode-cards .card {
|
.episode-cards .card {
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border: none;
|
border: none;
|
||||||
box-shadow: 0 2px 4px var(--shadow-color);
|
|
||||||
background: var(--card-bg);
|
background: var(--card-bg);
|
||||||
backdrop-filter: blur(5px);
|
backdrop-filter: blur(5px);
|
||||||
-webkit-backdrop-filter: blur(5px);
|
-webkit-backdrop-filter: blur(5px);
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.episode-cards .card-body {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-cards .episode-metadata {
|
||||||
|
border-top: 1px solid var(--border-color);
|
||||||
|
margin-top: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.episode-cards .card-title {
|
.episode-cards .card-title {
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@@ -116,10 +132,24 @@
|
|||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.card-title {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
.episode-image-container {
|
.episode-image-container {
|
||||||
height: 180px;
|
height: 180px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.episode-image-container img {
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-image-container img:hover {
|
||||||
|
transform: scale(1.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.episode-still {
|
.episode-still {
|
||||||
@@ -128,6 +158,107 @@
|
|||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ! Grid View */
|
||||||
|
.episode-cards-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
gap: 1rem;
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-cards-grid .card {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
/* height: 100%; */
|
||||||
|
border-radius: 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
border: none;
|
||||||
|
box-shadow: 0 2px 4px var(--shadow-color);
|
||||||
|
background: var(--card-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-cards-grid .episode-image-container {
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-cards-grid .card-body {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-cards-grid .episode-metadata {
|
||||||
|
padding-top: 0.5rem;
|
||||||
|
margin-top: auto;
|
||||||
|
border-top: 1px solid var(--border-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ! Grid-2 View */
|
||||||
|
.episode-cards-grid-2 {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
gap: 1rem;
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-cards-grid-2 .card {
|
||||||
|
position: relative;
|
||||||
|
border-radius: 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
border: none;
|
||||||
|
box-shadow: 0 2px 4px var(--shadow-color);
|
||||||
|
aspect-ratio: 16/9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-cards-grid-2 .episode-image-container {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-cards-grid-2 .episode-still {
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-cards-grid-2 .card-overlay {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.8);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 1rem;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-cards-grid-2 .card:hover .card-overlay {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-cards-grid-2 .card:hover .episode-still {
|
||||||
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-cards-grid-2 .card-title {
|
||||||
|
color: white;
|
||||||
|
font-size: 1rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-cards-grid-2 .episode-metadata {
|
||||||
|
margin-top: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-cards-grid-2 .episode-metadata small {
|
||||||
|
color: rgba(255, 255, 255, 0.7);
|
||||||
|
display: block;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Common Elements */
|
||||||
.btn-icon-only-success {
|
.btn-icon-only-success {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
@@ -149,15 +280,6 @@
|
|||||||
color: #007bff;
|
color: #007bff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.watch-history-section {
|
|
||||||
/* background: var(--card-bg); */
|
|
||||||
/* backdrop-filter: blur(5px); */
|
|
||||||
/* -webkit-backdrop-filter: blur(5px); */
|
|
||||||
border-radius: 10px;
|
|
||||||
/* padding: 20px; */
|
|
||||||
color: var(--text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.material-symbols-outlined {
|
.material-symbols-outlined {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
@@ -182,66 +304,93 @@
|
|||||||
color: var(--text-muted) !important;
|
color: var(--text-muted) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table {
|
.btn-mark {
|
||||||
margin-bottom: 0;
|
background: var(--card-bg);
|
||||||
color: var(--text-color);
|
opacity: var(--bg-opacity-secondary);
|
||||||
background-color: var(--bg-color-secondary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.table th {
|
/* View Mode Switcher */
|
||||||
border-top: none;
|
.view-mode-switcher {
|
||||||
color: var(--text-color);
|
display: flex;
|
||||||
background-color: var(--bg-color-secondary);
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table td {
|
.view-mode-switcher .btn-icon-only {
|
||||||
|
padding: 0.5rem;
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
border-radius: 5px;
|
||||||
|
background: transparent;
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
border-color: var(--border-color);
|
display: flex;
|
||||||
background-color: var(--bg-color-secondary);
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
align-content: center;
|
justify-content: center;
|
||||||
padding: 5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-outline-primary {
|
.view-mode-switcher .btn-icon-only.active {
|
||||||
color: var(--text-color);
|
background: var(--primary-color);
|
||||||
border-color: var(--border-color);
|
color: white;
|
||||||
|
border-color: var(--primary-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-outline-primary:hover {
|
.view-mode-switcher .btn-icon-only:hover {
|
||||||
background-color: var(--hover-bg);
|
background: var(--primary-color);
|
||||||
border-color: #007bff;
|
color: white;
|
||||||
|
border-color: var(--primary-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ! Description Toggle */
|
||||||
|
.episode-description {
|
||||||
|
display: -webkit-box;
|
||||||
|
/* Treat the element as a block box */
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
/* Vertical layout for lines */
|
||||||
|
-webkit-line-clamp: 3;
|
||||||
|
/* Limit to 2 lines */
|
||||||
|
overflow: hidden;
|
||||||
|
/* Hide overflowing content */
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
/* Add ellipsis (...) */
|
||||||
|
font-size: 14px;
|
||||||
|
/* Set your desired font size */
|
||||||
|
line-height: 1.5;
|
||||||
|
/* Adjust line height as needed */
|
||||||
|
max-height: calc(1.5 * 3 * 1em);
|
||||||
|
/* Ensure max-height matches two lines */
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-description.expanded {
|
||||||
|
max-height: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-description:not(.expanded)::after {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.show-more-less {
|
||||||
color: #007bff;
|
color: #007bff;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline;
|
||||||
|
margin-left: 0.25em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-outline-secondary {
|
.show-more-less:hover {
|
||||||
color: var(--text-color);
|
text-decoration: underline;
|
||||||
border-color: var(--border-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-outline-secondary:hover {
|
|
||||||
background-color: var(--hover-bg);
|
|
||||||
border-color: var(--text-muted);
|
|
||||||
color: var(--text-muted);
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-link {
|
|
||||||
color: var(--text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-link:hover {
|
|
||||||
color: #007bff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-link.text-danger {
|
|
||||||
color: #dc3545 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-link.text-danger:hover {
|
|
||||||
color: #bd2130 !important;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
|
.episode-cards-grid {
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
.episode-cards-grid-2 {
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
.episode-image-container {
|
.episode-image-container {
|
||||||
height: 200px;
|
height: 200px;
|
||||||
}
|
}
|
||||||
@@ -251,3 +400,11 @@
|
|||||||
padding: 15px;
|
padding: 15px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 576px) {
|
||||||
|
|
||||||
|
.episode-cards-grid,
|
||||||
|
.episode-cards-grid-2 {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
<!-- Fixed Background -->
|
<!-- Fixed Background -->
|
||||||
<div class="fixed-image"
|
<div class="fixed-image" [style.background-image]="'url('+ getBanner() +')'">
|
||||||
[style.background-image]="'url(http://localhost:4000/api/v1/media/entries/backdrops/original/1fb338bd-46ee-4caf-b736-f3c0e797ed88.jpg)'">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container content-wrapper main-container">
|
<div class="container content-wrapper main-container">
|
||||||
@@ -53,7 +52,7 @@
|
|||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<h2 class="title">{{selectedSeason.name}} </h2>
|
<h2 class="title">{{selectedSeason.name}} </h2>
|
||||||
<div class="season-actions">
|
<div class="season-actions">
|
||||||
<button class="btn btn-icon-only-success wh-48" (click)="markSeasonAsWatched()">
|
<button class="btn btn-icon-only-success btn-mark btn-mark wh-48" (click)="markSeasonAsWatched()">
|
||||||
<span class="material-symbols-outlined">check</span>
|
<span class="material-symbols-outlined">check</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -76,78 +75,137 @@
|
|||||||
|
|
||||||
<!-- Episodes List -->
|
<!-- Episodes List -->
|
||||||
<div class="episodes-section">
|
<div class="episodes-section">
|
||||||
<h3 class="mb-3">
|
<h3 class="mb-3 d-flex justify-content-between align-items-center">
|
||||||
Episodes <span class="text-muted">({{selectedSeason.episodes.length}})</span>
|
<span>
|
||||||
|
Episodes <span class="text-muted">({{selectedSeason.episodes.length}})</span>
|
||||||
|
</span>
|
||||||
|
<div class="view-mode-switcher">
|
||||||
|
<button class="btn btn-icon-only" (click)="setViewMode('list')"
|
||||||
|
[ngClass]="{'active': episodesViewMode === 'list'}">
|
||||||
|
<span class="material-symbols-outlined">list</span>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-icon-only" (click)="setViewMode('grid')"
|
||||||
|
[ngClass]="{'active': episodesViewMode === 'grid'}">
|
||||||
|
<span class="material-symbols-outlined">grid_view</span>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-icon-only" (click)="setViewMode('grid-2')"
|
||||||
|
[ngClass]="{'active': episodesViewMode === 'grid-2'}">
|
||||||
|
<span class="material-symbols-outlined">grid_on</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</h3>
|
</h3>
|
||||||
<div class="episode-cards">
|
|
||||||
|
<!-- Episodes List - list view -->
|
||||||
|
<div class="episode-cards" *ngIf="episodesViewMode === 'list'">
|
||||||
<div class="card mb-3" *ngFor="let episode of selectedSeason.episodes">
|
<div class="card mb-3" *ngFor="let episode of selectedSeason.episodes">
|
||||||
<div class="row g-0">
|
<div class="row g-0">
|
||||||
<div class="col-md-3 episode-image-container">
|
<div class="col-md-3 episode-image-container" (click)="showEpisodeDetails($event, episode)">
|
||||||
<img [src]="posterPath(episode.still_path)" class="episode-still" alt="Episode Still">
|
<img [src]="posterPath(episode.still_path)" class="episode-still" alt="Episode Still">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<h5 class="card-title">{{episode.episode_number}}. {{episode.name}}</h5>
|
<h5 class="card-title" (click)="showEpisodeDetails($event, episode)">{{episode.episode_number}}.
|
||||||
|
{{episode.name}}</h5>
|
||||||
<div class="episode-actions">
|
<div class="episode-actions">
|
||||||
<button class="btn btn-icon-only-success wh-48" (click)="markEpisodeAsWatched(episode)">
|
<button class="btn btn-icon-only-success btn-mark wh-48"
|
||||||
|
(click)="markEpisodeAsWatched($event, episode)">
|
||||||
<span class="material-symbols-outlined">check</span>
|
<span class="material-symbols-outlined">check</span>
|
||||||
</button>
|
</button>
|
||||||
<!-- <button class="btn btn-icon-only-success wh-48">
|
|
||||||
<span class="material-symbols-outlined">info</span>
|
|
||||||
</button> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="card-text">{{episode.overview}}</p>
|
<p class="card-text episode-description">
|
||||||
<p class="card-text">
|
{{episode.overview}}
|
||||||
<small class="text-muted" *ngIf="episode.air_date">
|
|
||||||
Air date: {{episode.air_date | date:'MMM dd, yyyy'}}
|
|
||||||
</small>
|
|
||||||
<small class="text-muted" *ngIf="episode.runtime"> • Runtime: {{episode.runtime |
|
|
||||||
betterMinutesFormat}}
|
|
||||||
</small>
|
|
||||||
<small class="text-muted" *ngIf="episode.date_first_seen">
|
|
||||||
• Seen: {{episode.date_first_seen | date:'MMM dd, yyyy'}}
|
|
||||||
</small>
|
|
||||||
</p>
|
</p>
|
||||||
|
<div class="episode-metadata">
|
||||||
|
<p class="card-text">
|
||||||
|
<small class="text-muted" *ngIf="episode.air_date">
|
||||||
|
Air date: {{episode.air_date | date:'MMM dd, yyyy'}}
|
||||||
|
</small>
|
||||||
|
<small class="text-muted" *ngIf="episode.runtime"> • Runtime: {{episode.runtime |
|
||||||
|
betterMinutesFormat}}
|
||||||
|
</small>
|
||||||
|
<small class="text-muted" *ngIf="episode.date_first_seen">
|
||||||
|
• Seen: {{episode.date_first_seen | date:'MMM dd, yyyy'}}
|
||||||
|
</small>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Watch History -->
|
<!-- Episodes List - grid view -->
|
||||||
<div class="watch-history-section mt-4">
|
<div class="episode-cards-grid" *ngIf="episodesViewMode === 'grid'">
|
||||||
<h3 class="mb-3">Watch History</h3>
|
<div class="card" *ngFor="let episode of selectedSeason.episodes">
|
||||||
<div class="table-responsive">
|
<div class="episode-image-container" (click)="showEpisodeDetails($event, episode)">
|
||||||
<table class="table">
|
<img [src]="posterPath(episode.still_path)" class="episode-still" alt="Episode Still">
|
||||||
<thead>
|
</div>
|
||||||
<tr>
|
<div class="card-body">
|
||||||
<th>Episode</th>
|
<div class="d-flex justify-content-between">
|
||||||
<th>Date Watched</th>
|
<h5 class="card-title" (click)="showEpisodeDetails($event, episode)">{{episode.episode_number}}.
|
||||||
<th>Watched With</th>
|
{{episode.name}}</h5>
|
||||||
<th>Actions</th>
|
<div class="episode-actions">
|
||||||
</tr>
|
<button class="btn btn-icon-only-success btn-mark wh-48"
|
||||||
</thead>
|
(click)="markEpisodeAsWatched($event, episode)">
|
||||||
<tbody>
|
<span class="material-symbols-outlined">check</span>
|
||||||
<tr *ngFor="let ep of watchHistory">
|
|
||||||
<td>Episode {{ep.episode.episode_number}}</td>
|
|
||||||
<td>{{ep.date_seen | date:'MMM dd, yyyy'}}</td>
|
|
||||||
<td>{{ep.seen_with}}</td>
|
|
||||||
<td>
|
|
||||||
<button class="btn btn-sm btn-link">
|
|
||||||
<span class="material-symbols-outlined">edit</span>
|
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-sm btn-link text-danger">
|
</div>
|
||||||
<span class="material-symbols-outlined">delete</span>
|
</div>
|
||||||
|
<p class="card-text episode-description" *ngIf="episode.overview">
|
||||||
|
{{ episode.overview }}
|
||||||
|
<!-- <span class="show-more-less" *ngIf="episode.overview.length > 100"
|
||||||
|
(click)="showEpisodeDetails(episode)">more...</span> -->
|
||||||
|
</p>
|
||||||
|
<div class="episode-metadata">
|
||||||
|
<p class="card-text">
|
||||||
|
<small class="text-muted" *ngIf="episode.air_date">
|
||||||
|
{{episode.air_date | date:'MMM dd, yyyy'}}
|
||||||
|
</small>
|
||||||
|
<small class="text-muted" *ngIf="episode.runtime"> • {{episode.runtime |
|
||||||
|
betterMinutesFormat}}
|
||||||
|
</small>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Episodes List - grid-2 view -->
|
||||||
|
<div class="episode-cards-grid-2" *ngIf="episodesViewMode === 'grid-2'">
|
||||||
|
<div class="card" *ngFor="let episode of selectedSeason.episodes">
|
||||||
|
<div class="episode-image-container">
|
||||||
|
<img [src]="posterPath(episode.still_path)" class="episode-still" alt="Episode Still">
|
||||||
|
</div>
|
||||||
|
<div class="card-overlay">
|
||||||
|
<div class="d-flex justify-content-between align-items-start">
|
||||||
|
<h5 class="card-title" (click)="showEpisodeDetails($event, episode)">{{episode.episode_number}}.
|
||||||
|
{{episode.name}}</h5>
|
||||||
|
<div class="episode-actions">
|
||||||
|
<button class="btn btn-icon-only-success btn-mark" (click)="markEpisodeAsWatched($event, episode)">
|
||||||
|
<span class="material-symbols-outlined">check</span>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
</tbody>
|
<div class="episode-metadata">
|
||||||
</table>
|
<small *ngIf="episode.air_date">
|
||||||
|
Air date: {{episode.air_date | date:'MMM dd, yyyy'}}
|
||||||
|
</small>
|
||||||
|
<small *ngIf="episode.runtime">
|
||||||
|
Runtime: {{episode.runtime | betterMinutesFormat}}
|
||||||
|
</small>
|
||||||
|
<small *ngIf="episode.date_first_seen">
|
||||||
|
Seen: {{episode.date_first_seen | date:'MMM dd, yyyy'}}
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<app-episode-dialog *ngIf="selectedEpisode" [episode]="selectedEpisode!" [posterPath]="posterPath"
|
||||||
|
(close)="selectedEpisode = undefined"></app-episode-dialog>
|
||||||
@@ -7,6 +7,10 @@ import { MatDialog } from '@angular/material/dialog';
|
|||||||
import { SeenModalComponent } from '../../../shared/components/modals/seen-modal/seen-modal.component';
|
import { SeenModalComponent } from '../../../shared/components/modals/seen-modal/seen-modal.component';
|
||||||
import { Episode } from '../../../shared/models/episode.models';
|
import { Episode } from '../../../shared/models/episode.models';
|
||||||
import { EpisodeSeen } from '../../../shared/models/episode-seen.model';
|
import { EpisodeSeen } from '../../../shared/models/episode-seen.model';
|
||||||
|
import { Entry } from '../../../shared/models/entry.model';
|
||||||
|
import { ConfigService } from '../../../core/services/config.service';
|
||||||
|
import { SettingsService } from '../../../core/services/settings.service';
|
||||||
|
import { Settings } from '../../../shared/models/settings.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-season-page',
|
selector: 'app-season-page',
|
||||||
@@ -15,15 +19,21 @@ import { EpisodeSeen } from '../../../shared/models/episode-seen.model';
|
|||||||
})
|
})
|
||||||
export class SeasonPageComponent implements OnInit {
|
export class SeasonPageComponent implements OnInit {
|
||||||
entryId!: number;
|
entryId!: number;
|
||||||
|
entry!: Entry;
|
||||||
seasonNumber!: number;
|
seasonNumber!: number;
|
||||||
seasons: Season[] = [];
|
seasons: Season[] = [];
|
||||||
selectedSeason!: Season;
|
selectedSeason!: Season;
|
||||||
watchHistory: EpisodeSeen[] = [];
|
watchHistory: EpisodeSeen[] = [];
|
||||||
|
|
||||||
|
episodesViewMode: string = 'grid';
|
||||||
|
selectedEpisode: Episode | undefined;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
|
||||||
private entryService: EntryService,
|
|
||||||
private episodeSeenService: EpisodeSeenService,
|
private episodeSeenService: EpisodeSeenService,
|
||||||
|
private settingsService: SettingsService,
|
||||||
|
private configService: ConfigService,
|
||||||
|
private entryService: EntryService,
|
||||||
|
private route: ActivatedRoute,
|
||||||
private dialog: MatDialog
|
private dialog: MatDialog
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
@@ -32,6 +42,15 @@ export class SeasonPageComponent implements OnInit {
|
|||||||
this.entryId = Number(params.get('id'));
|
this.entryId = Number(params.get('id'));
|
||||||
this.seasonNumber = Number(params.get('seasonNumber'));
|
this.seasonNumber = Number(params.get('seasonNumber'));
|
||||||
|
|
||||||
|
this.entryService.getEntryById(this.entryId).subscribe({
|
||||||
|
next: (result) => {
|
||||||
|
this.entry = result;
|
||||||
|
},
|
||||||
|
error: () => {
|
||||||
|
console.log(`Couldn't fetch entry.`);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
// Fetch all seasons for the entryId
|
// Fetch all seasons for the entryId
|
||||||
this.entryService.getEntrySeasons(this.entryId).subscribe({
|
this.entryService.getEntrySeasons(this.entryId).subscribe({
|
||||||
next: (result) => {
|
next: (result) => {
|
||||||
@@ -51,6 +70,8 @@ export class SeasonPageComponent implements OnInit {
|
|||||||
console.log(this.watchHistory);
|
console.log(this.watchHistory);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.getDefaultViewMode();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +83,8 @@ export class SeasonPageComponent implements OnInit {
|
|||||||
return 'assets/images/default/default-poster.png';
|
return 'assets/images/default/default-poster.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
async markEpisodeAsWatched(episode: Episode) {
|
async markEpisodeAsWatched(event: Event, episode: Episode) {
|
||||||
|
event.stopPropagation();
|
||||||
const dialogRef = this.dialog.open(SeenModalComponent, {
|
const dialogRef = this.dialog.open(SeenModalComponent, {
|
||||||
width: '400px',
|
width: '400px',
|
||||||
});
|
});
|
||||||
@@ -101,8 +123,8 @@ export class SeasonPageComponent implements OnInit {
|
|||||||
width: '400px',
|
width: '400px',
|
||||||
data: {
|
data: {
|
||||||
hideSeenWith: true,
|
hideSeenWith: true,
|
||||||
title: 'Mark Season As Watched'
|
title: 'Mark Season As Watched',
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
await dialogRef.afterClosed().subscribe((result) => {
|
await dialogRef.afterClosed().subscribe((result) => {
|
||||||
@@ -136,4 +158,67 @@ export class SeasonPageComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toggleDescription(episode: any) {
|
||||||
|
episode.showFullDescription = !episode.showFullDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
showEpisodeDetails(event: Event, episode: Episode) {
|
||||||
|
event.stopPropagation();
|
||||||
|
episode.episodeSeen = this.watchHistory.filter(
|
||||||
|
(w) => w.episode_id == episode.id
|
||||||
|
);
|
||||||
|
this.selectedEpisode = episode;
|
||||||
|
}
|
||||||
|
|
||||||
|
getBanner() {
|
||||||
|
// * Is in library: use a local backdrop
|
||||||
|
if (this.entry.medias) {
|
||||||
|
const selectedBackdrop = this.entry.medias.filter(
|
||||||
|
(m) => m.type == 'backdrop' && m.isSelected
|
||||||
|
);
|
||||||
|
|
||||||
|
if (
|
||||||
|
selectedBackdrop.length &&
|
||||||
|
selectedBackdrop[0] &&
|
||||||
|
selectedBackdrop[0].path
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
this.configService.getBackendApiUrl() +
|
||||||
|
`/media/entries/backdrops/original/${selectedBackdrop[0].path}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// * No local backdrop available, Use TMDB backdrop
|
||||||
|
if (this.entry.banner_path)
|
||||||
|
return `https://image.tmdb.org/t/p/w1280` + this.entry.banner_path;
|
||||||
|
|
||||||
|
// * No backdrop found, use default backdrop image as a last stand
|
||||||
|
return 'assets/images/default/default-poster.png';
|
||||||
|
}
|
||||||
|
|
||||||
|
getDefaultViewMode() {
|
||||||
|
const obs = this.settingsService.getSettings().subscribe({
|
||||||
|
next: (s) => {
|
||||||
|
this.episodesViewMode = s.episodesViewMode || 'grid';
|
||||||
|
},
|
||||||
|
complete: () => {
|
||||||
|
obs.unsubscribe();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
setViewMode(mode: string) {
|
||||||
|
this.episodesViewMode = mode;
|
||||||
|
const newSettings = { episodesViewMode: this.episodesViewMode } as Settings;
|
||||||
|
const obs = this.settingsService.updateSettings(newSettings).subscribe({
|
||||||
|
next: (s) => {
|
||||||
|
// ? view mode updated
|
||||||
|
},
|
||||||
|
complete: () => {
|
||||||
|
obs.unsubscribe();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -45,27 +45,29 @@ export class SeenModalComponent implements OnInit {
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
if (this.data.title) {
|
if (this.data) {
|
||||||
this.title = this.data.title;
|
if (this.data.title) {
|
||||||
}
|
this.title = this.data.title;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.data.watchedWith)
|
if (this.data.watchedWith)
|
||||||
this.watchedWith = this.data.watchedWith.split(', ').join('\n');
|
this.watchedWith = this.data.watchedWith.split(', ').join('\n');
|
||||||
|
|
||||||
if (this.data.hideSeenWith) {
|
if (this.data.hideSeenWith) {
|
||||||
this.hideSeenWith = this.data.hideSeenWith;
|
this.hideSeenWith = this.data.hideSeenWith;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ? no initial data was passed: populate date field with current date
|
// ? no initial data was passed: populate date field with current date
|
||||||
if (!this.data.watchDate) {
|
if (this.data.watchDate) {
|
||||||
this.watchDate = formatDate(new Date(), 'yyyy-MM-dd', 'en-US');
|
// ? if data is passed, populate fields
|
||||||
|
this.watchDate = formatDate(
|
||||||
|
new Date(this.data.watchDate),
|
||||||
|
'yyyy-MM-dd',
|
||||||
|
'en-US'
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// ? if data is passed, populate fields
|
this.watchDate = formatDate(new Date(), 'yyyy-MM-dd', 'en-US');
|
||||||
this.watchDate = formatDate(
|
|
||||||
new Date(this.data.watchDate),
|
|
||||||
'yyyy-MM-dd',
|
|
||||||
'en-US'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { EpisodeSeen } from "./episode-seen.model";
|
import { EpisodeSeen } from './episode-seen.model';
|
||||||
import { Season } from "./season.model";
|
import { Season } from './season.model';
|
||||||
|
|
||||||
export interface Episode {
|
export interface Episode {
|
||||||
id: number;
|
id: number;
|
||||||
@@ -29,6 +29,9 @@ export interface Episode {
|
|||||||
date_first_seen: Date;
|
date_first_seen: Date;
|
||||||
date_last_seen: Date;
|
date_last_seen: Date;
|
||||||
|
|
||||||
|
// front fields
|
||||||
|
showFullDescription: boolean;
|
||||||
|
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
updatedAt: Date;
|
updatedAt: Date;
|
||||||
}
|
}
|
||||||
@@ -11,4 +11,5 @@ export interface Settings {
|
|||||||
watchlistViewMode: string;
|
watchlistViewMode: string;
|
||||||
CollectionsViewMode: string;
|
CollectionsViewMode: string;
|
||||||
CollectionItemsViewMode: string;
|
CollectionItemsViewMode: string;
|
||||||
|
episodesViewMode: string;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user