tagsAllOf?: string[]
token?: string
expectedStatus?: HttpStatusCode
+ excludeAlreadyWatched?: boolean
}) {
const res = await makeGetRequest({
url: options.server.url,
path: options.path,
token: options.token ?? options.server.accessToken,
query: {
- ...pick(options, [ 'isLocal', 'include', 'category', 'tagsAllOf', 'hasWebtorrentFiles', 'hasHLSFiles', 'privacyOneOf' ]),
+ ...pick(options, [
+ 'isLocal',
+ 'include',
+ 'category',
+ 'tagsAllOf',
+ 'hasWebtorrentFiles',
+ 'hasHLSFiles',
+ 'privacyOneOf',
+ 'excludeAlreadyWatched'
+ ]),
sort: 'createdAt'
},
token?: string
expectedStatus?: HttpStatusCode
skipSubscription?: boolean
+ excludeAlreadyWatched?: boolean
}
) {
const { skipSubscription = false } = options
}
}
})
+
+ it('Should filter already watched videos by the user', async function () {
+ const { id } = await servers[0].videos.upload({ attributes: { name: 'video for history' } })
+
+ for (const path of paths) {
+ const videos = await listVideos({ server: servers[0], path, isLocal: true, excludeAlreadyWatched: true })
+ const foundVideo = videos.find(video => video.id === id)
+
+ expect(foundVideo).to.not.be.undefined
+ }
+ await servers[0].views.view({ id, token: servers[0].accessToken })
+
+ for (const path of paths) {
+ const videos = await listVideos({ server: servers[0], path, excludeAlreadyWatched: true })
+ const foundVideo = videos.find(video => video.id === id)
+
+ expect(foundVideo).to.be.undefined
+ }
+ })
})
after(async function () {