Skip to content

Commit f24cff3

Browse files
authored
Update metadata once a day (#1543)
This is important to get updates to stale entries, particularly images
1 parent 006f574 commit f24cff3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/models/MediaMetadata.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ const isTypeEpisode = function(context?: MediaMetadataInterface): boolean {
5151
return context ? context.type === 'episode' : this.type === 'episode';
5252
};
5353

54+
const ONE_DAY_IN_SECONDS = 86400; // 1 day
55+
5456
const MediaMetadataSchema: Schema = new Schema({
5557
actors: { type: Array },
5658
awards: { type: String },
@@ -59,9 +61,10 @@ const MediaMetadataSchema: Schema = new Schema({
5961
collectionTmdbID: { type: Number },
6062
country: { type: String },
6163
createdAt: {
62-
type: Date,
6364
default: Date.now,
65+
expires: ONE_DAY_IN_SECONDS,
6466
select: false,
67+
type: Date,
6568
},
6669
credits: { type: Array },
6770
directors: { type: Array },

0 commit comments

Comments
 (0)