@@ -160,25 +160,48 @@ const movieWatched = computed(() => {
160
160
return getMovieWatched (_item .meta .ids .movie .trakt )?.value ;
161
161
});
162
162
163
+ const moviePlayed = computed (() => {
164
+ if (! showPlayed .value ) return ;
165
+ if (movieWatched .value !== undefined ) return movieWatched .value ?.last_watched_at ;
166
+ return movieHistory .value ?.watched_at ;
167
+ });
168
+
169
+ const episodePlayed = computed (() => {
170
+ if (! showPlayed .value ) return ;
171
+ if (episodeProgress .value !== undefined ) {
172
+ return {
173
+ date: episodeProgress .value ?.date ,
174
+ completed: episodeProgress .value ?.completed ,
175
+ };
176
+ }
177
+ return {
178
+ date: episodeHistory .value ?.watched_at ,
179
+ completed: !! episodeHistory .value ,
180
+ };
181
+ });
182
+
163
183
const played = computed (() => {
164
184
if (! showPlayed .value ) return false ;
165
- const _item = item ?.value ;
166
- if (_item ?.type === ' movie' ) {
167
- const _watched = movieWatched .value ;
168
- if (_watched !== undefined ) return !! _watched .plays ;
169
- return !! movieHistory .value ;
185
+ if (item ?.value ?.type === ' movie' ) return !! moviePlayed .value ;
186
+ if (item ?.value ?.type !== ' episode' ) return false ;
187
+ return episodePlayed .value ?.completed ;
188
+ });
189
+
190
+ const playedDate = computed (() => {
191
+ if (! played .value ) return ;
192
+ if (item ?.value ?.type === ' movie' ) {
193
+ if (! moviePlayed .value ) return ;
194
+ return new Date (moviePlayed .value ).toLocaleString ();
170
195
}
171
- if (_item ?.type !== ' episode' ) return false ;
172
- const _progress = episodeProgress .value ;
173
- if (_progress !== undefined ) return _progress .completed ;
174
- return !! episodeHistory .value ;
196
+ if (! episodePlayed .value ?.date ) return ;
197
+ return new Date (episodePlayed .value ?.date ).toLocaleString ();
175
198
});
176
199
177
200
const collected = computed (() => {
178
201
if (! showCollected .value ) return false ;
179
202
const _item = item ?.value ;
180
203
if (_item ?.type === ' movie' && _item ?.meta ?.ids ?.movie ?.trakt ) {
181
- return getMovieCollected (_item .meta .ids .movie .trakt )?.value ;
204
+ return getMovieCollected (_item .meta .ids .movie .trakt )?.value ?. collected_at ;
182
205
}
183
206
if (_item ?.type !== ' episode' ) return false ;
184
207
const _collection = collection .value ;
@@ -189,7 +212,13 @@ const collected = computed(() => {
189
212
if (! _season || ! _episode ) return false ;
190
213
return _collection .seasons
191
214
?.find (s => s .number === _season )
192
- ?.episodes ?.find (e => e .number === _episode )?.completed ;
215
+ ?.episodes ?.find (e => e .number === _episode )?.date ;
216
+ });
217
+
218
+ const collectedDate = computed (() => {
219
+ if (! collected .value ) return ;
220
+ if (typeof collected .value !== ' string' ) return ;
221
+ return new Date (collected .value ).toLocaleString ();
193
222
});
194
223
195
224
const { progressType } = useExtensionSettingsStoreRefs ();
@@ -272,7 +301,10 @@ const onTagClick = (url?: string) => {
272
301
size =" small"
273
302
type =" info"
274
303
:bordered =" false"
275
- :title =" i18n('collected', 'common', 'tooltip')"
304
+ :title ="
305
+ i18n('collected', 'common', 'tooltip') +
306
+ (collectedDate ? `: ${ collectedDate }` : '')
307
+ "
276
308
>
277
309
<template #icon >
278
310
<NIcon :component =" IconGrid" />
@@ -288,7 +320,9 @@ const onTagClick = (url?: string) => {
288
320
size =" small"
289
321
type =" primary"
290
322
:bordered =" false"
291
- :title =" i18n('watched', 'common', 'tooltip')"
323
+ :title ="
324
+ i18n('watched', 'common', 'tooltip') + (playedDate ? `: ${ playedDate }` : '')
325
+ "
292
326
>
293
327
<template #icon >
294
328
<NIcon :component =" IconPlayFilled" />
0 commit comments