minor fixes

This commit is contained in:
X4Lo committed 2024-05-11 09:00:39 +01:00
1 parent 8a08958ae3
commit af8ec38b62
3 files changed
+13 -12

No files matched your search

+1
View File
@@ -45,3 +45,4 @@ testem.log
.DS_Store .DS_Store
Thumbs.db Thumbs.db
.vscode/settings.json
+2 -1
View File
@@ -223,7 +223,8 @@ EpisodeSeen.afterCreate(async (instance, options) => {
// this will ensure that the entry is updated anyways to trigger the updatedAt property // this will ensure that the entry is updated anyways to trigger the updatedAt property
let update = { let update = {
title: sequelize.literal('title') // title: sequelize.literal('title')
watchlist: false
}; };
// ? comparing the instance.date_seen with the entry date_first_seen & // ? comparing the instance.date_seen with the entry date_first_seen &
@@ -3,7 +3,6 @@ import { Season } from '../../../shared/models/season.model';
import { SeasonService } from '../../../core/services/season.service'; import { SeasonService } from '../../../core/services/season.service';
import { import {
trigger, trigger,
state,
style, style,
transition, transition,
animate, animate,
@@ -35,7 +34,7 @@ export class SeasonMainCardComponent implements OnInit {
@Output() episodeWatchedEvent = new EventEmitter(); @Output() episodeWatchedEvent = new EventEmitter();
@Input() season: Season = {} as Season; @Input() season: Season = {} as Season;
isChecked: boolean = false; isChecked: boolean = false;
isLocked: boolean = false; lockActions: boolean = false;
constructor( constructor(
private seasonService: SeasonService, private seasonService: SeasonService,
@@ -46,7 +45,7 @@ export class SeasonMainCardComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.seasonService.getSeasonEpisodes(this.season.id).subscribe({ this.seasonService.getSeasonEpisodes(this.season.id).subscribe({
next: (episodes) => { next: (episodes) => {
console.log(`Loaded Season Episodes: `, episodes); // console.log(`Loaded Season Episodes: `, episodes);
this.season.episodes = episodes; this.season.episodes = episodes;
}, },
error: (error) => { error: (error) => {
@@ -86,8 +85,8 @@ export class SeasonMainCardComponent implements OnInit {
return count; return count;
} }
async episodeMarkSeenClick() { async episodeMarkSeenClick() {
if (this.isLocked) return; if (this.lockActions) return;
this.isLocked = true; this.lockActions = true;
let selectedEpisode = {} as Episode; let selectedEpisode = {} as Episode;
let selectedEpisodeIndex = -1; let selectedEpisodeIndex = -1;
@@ -127,14 +126,14 @@ export class SeasonMainCardComponent implements OnInit {
width: '400px', width: '400px',
}); });
console.log('Episode seen dialog opened'); // console.log('Episode seen dialog opened');
await dialogRef.afterClosed().subscribe((result) => { await dialogRef.afterClosed().subscribe((result) => {
if (result) { if (result) {
console.log('Episode seen dialog closed with:', result); // console.log('Episode seen dialog closed with:', result);
if (result.watchDate == '') { if (result.watchDate == '') {
// TODO show no date was passed notification // TODO show no date was passed notification
this.isLocked = false; this.lockActions = false;
return; return;
} }
@@ -150,7 +149,7 @@ export class SeasonMainCardComponent implements OnInit {
) )
.subscribe({ .subscribe({
next: (episodeSeen) => { next: (episodeSeen) => {
console.log(`Episode marked as seen`, episodeSeen); // console.log(`Episode marked as seen`, episodeSeen);
// TODO get actualy date_first_seen & date_last_seen for episode seen (not just place holders) // TODO get actualy date_first_seen & date_last_seen for episode seen (not just place holders)
this.season.episodes[selectedEpisodeIndex].date_first_seen = this.season.episodes[selectedEpisodeIndex].date_first_seen =
new Date(); new Date();
@@ -164,12 +163,12 @@ export class SeasonMainCardComponent implements OnInit {
// TODO show notification // TODO show notification
}, },
complete: () => { complete: () => {
this.isLocked = false; this.lockActions = false;
}, },
}); });
} else { } else {
console.log('Seen dialog was cancelled'); console.log('Seen dialog was cancelled');
this.isLocked = false; this.lockActions = false;
} }
}); });
} }