MCPcopy Create free account
hub / github.com/MALSync/MALSync / fixDates

Function fixDates

src/_provider/singleAbstract.ts:673–694  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

671 }
672
673 private fixDates() {
674 if (!this.supportsDates() || this.getSyncMethod() === 'listSync') {
675 return;
676 }
677
678 const today = returnYYYYMMDD();
679 if (
680 this.getStartDate() === null &&
681 this._getStatus() === definitions.status.Watching &&
682 this._getEpisode() > 0
683 ) {
684 this.setStartDate(today);
685 }
686
687 if (this.getFinishDate() === null && this._getStatus() === definitions.status.Completed) {
688 this.setFinishDate(today);
689
690 if (this.getStartDate() === null) {
691 this.setStartDate(today);
692 }
693 }
694 }
695
696 public async lifeCycleHook(state: 'afterCheckSync' | 'beforeSync') {
697 if (this.askCompleted) {

Callers

nothing calls this directly

Calls 3

returnYYYYMMDDFunction · 0.90
_getStatusMethod · 0.45
_getEpisodeMethod · 0.45

Tested by

no test coverage detected