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
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
let update = {
title: sequelize.literal('title')
// title: sequelize.literal('title')
watchlist: false
};
// ? 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 {
trigger,
state,
style,
transition,
animate,
@@ -35,7 +34,7 @@ export class SeasonMainCardComponent implements OnInit {
@Output() episodeWatchedEvent = new EventEmitter();
@Input() season: Season = {} as Season;
isChecked: boolean = false;
isLocked: boolean = false;
lockActions: boolean = false;
constructor(
private seasonService: SeasonService,
@@ -46,7 +45,7 @@ export class SeasonMainCardComponent implements OnInit {
ngOnInit(): void {
this.seasonService.getSeasonEpisodes(this.season.id).subscribe({
next: (episodes) => {
console.log(`Loaded Season Episodes: `, episodes);
// console.log(`Loaded Season Episodes: `, episodes);
this.season.episodes = episodes;
},
error: (error) => {
@@ -86,8 +85,8 @@ export class SeasonMainCardComponent implements OnInit {
return count;
}
async episodeMarkSeenClick() {
if (this.isLocked) return;
this.isLocked = true;
if (this.lockActions) return;
this.lockActions = true;
let selectedEpisode = {} as Episode;
let selectedEpisodeIndex = -1;
@@ -127,14 +126,14 @@ export class SeasonMainCardComponent implements OnInit {
width: '400px',
});
console.log('Episode seen dialog opened');
// console.log('Episode seen dialog opened');
await dialogRef.afterClosed().subscribe((result) => {
if (result) {
console.log('Episode seen dialog closed with:', result);
// console.log('Episode seen dialog closed with:', result);
if (result.watchDate == '') {
// TODO show no date was passed notification
this.isLocked = false;
this.lockActions = false;
return;
}
@@ -150,7 +149,7 @@ export class SeasonMainCardComponent implements OnInit {
)
.subscribe({
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)
this.season.episodes[selectedEpisodeIndex].date_first_seen =
new Date();
@@ -164,12 +163,12 @@ export class SeasonMainCardComponent implements OnInit {
// TODO show notification
},
complete: () => {
this.isLocked = false;
this.lockActions = false;
},
});
} else {
console.log('Seen dialog was cancelled');
this.isLocked = false;
this.lockActions = false;
}
});
}