diff options
author | Wicklow <123956049+wickloww@users.noreply.github.com> | 2023-04-12 07:32:20 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-12 09:32:20 +0200 |
commit | 2a4c0d8bbe29178ae90e776bb9453f86e6d23bd9 (patch) | |
tree | dfe4b6e1e06f617f8968285ca394e73fedefe6b2 /server/models/video/video.ts | |
parent | 0cda019c1d1f77e06e524362880c38e93b1f5c70 (diff) | |
download | PeerTube-2a4c0d8bbe29178ae90e776bb9453f86e6d23bd9.tar.gz PeerTube-2a4c0d8bbe29178ae90e776bb9453f86e6d23bd9.tar.zst PeerTube-2a4c0d8bbe29178ae90e776bb9453f86e6d23bd9.zip |
Feature/filter already watched videos (#5739)
* filter already watched videos
* Updated code based on review comments
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r-- | server/models/video/video.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 0c5ed64ec..f817c4a33 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -1086,6 +1086,8 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> { | |||
1086 | countVideos?: boolean | 1086 | countVideos?: boolean |
1087 | 1087 | ||
1088 | search?: string | 1088 | search?: string |
1089 | |||
1090 | excludeAlreadyWatched?: boolean | ||
1089 | }) { | 1091 | }) { |
1090 | VideoModel.throwIfPrivateIncludeWithoutUser(options.include, options.user) | 1092 | VideoModel.throwIfPrivateIncludeWithoutUser(options.include, options.user) |
1091 | VideoModel.throwIfPrivacyOneOfWithoutUser(options.privacyOneOf, options.user) | 1093 | VideoModel.throwIfPrivacyOneOfWithoutUser(options.privacyOneOf, options.user) |
@@ -1124,7 +1126,8 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> { | |||
1124 | 'historyOfUser', | 1126 | 'historyOfUser', |
1125 | 'hasHLSFiles', | 1127 | 'hasHLSFiles', |
1126 | 'hasWebtorrentFiles', | 1128 | 'hasWebtorrentFiles', |
1127 | 'search' | 1129 | 'search', |
1130 | 'excludeAlreadyWatched' | ||
1128 | ]), | 1131 | ]), |
1129 | 1132 | ||
1130 | serverAccountIdForBlock: serverActor.Account.id, | 1133 | serverAccountIdForBlock: serverActor.Account.id, |
@@ -1170,6 +1173,8 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> { | |||
1170 | durationMin?: number // seconds | 1173 | durationMin?: number // seconds |
1171 | durationMax?: number // seconds | 1174 | durationMax?: number // seconds |
1172 | uuids?: string[] | 1175 | uuids?: string[] |
1176 | |||
1177 | excludeAlreadyWatched?: boolean | ||
1173 | }) { | 1178 | }) { |
1174 | VideoModel.throwIfPrivateIncludeWithoutUser(options.include, options.user) | 1179 | VideoModel.throwIfPrivateIncludeWithoutUser(options.include, options.user) |
1175 | VideoModel.throwIfPrivacyOneOfWithoutUser(options.privacyOneOf, options.user) | 1180 | VideoModel.throwIfPrivacyOneOfWithoutUser(options.privacyOneOf, options.user) |
@@ -1203,7 +1208,8 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> { | |||
1203 | 'hasWebtorrentFiles', | 1208 | 'hasWebtorrentFiles', |
1204 | 'uuids', | 1209 | 'uuids', |
1205 | 'search', | 1210 | 'search', |
1206 | 'displayOnlyForFollower' | 1211 | 'displayOnlyForFollower', |
1212 | 'excludeAlreadyWatched' | ||
1207 | ]), | 1213 | ]), |
1208 | serverAccountIdForBlock: serverActor.Account.id | 1214 | serverAccountIdForBlock: serverActor.Account.id |
1209 | } | 1215 | } |