diff --git a/.gitignore b/.gitignore index 469d9d6..eaf8d13 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ testem.log .DS_Store Thumbs.db +.vscode/settings.json diff --git a/backend/db/sequelizeHooks.js b/backend/db/sequelizeHooks.js index 4bfb6a4..fe4d855 100644 --- a/backend/db/sequelizeHooks.js +++ b/backend/db/sequelizeHooks.js @@ -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 & diff --git a/frontend/src/app/features/entry/season-main-card/season-main-card.component.ts b/frontend/src/app/features/entry/season-main-card/season-main-card.component.ts index fe7fdfd..a4ffa0c 100644 --- a/frontend/src/app/features/entry/season-main-card/season-main-card.component.ts +++ b/frontend/src/app/features/entry/season-main-card/season-main-card.component.ts @@ -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; } }); }