-
Notifications
You must be signed in to change notification settings - Fork 1
Swap notes
New table rules
ruleId (primary key autoincrement)
replaceType
replaceId
comment
user
*(replaceType, replaceId) Unique
Comments should always describe the replacement video (eg Official upload) because the comments are saved in the rules table (along with the replacement type/id) and not the videos table.
New column swapId (foreign key linked to column ruleId in table rule) in videos table.
sqlite3 can't add a new column with constraints so the table must be rebuilt with that column.
-In CyTube, we can only use pos next/end to add to playlist after recent patch.
-Handle cases where the replacement video is already in the playlist.
.....If lower than added video, bump
.....If higher than added video, do nothing else
-Handle cases where a $swap rule is added, and the bad video is currently playing. [to do]
.....add good video above the currently playing bad video.
.....temp bad video.
Make $swap very restrictive so that rules never lead to a chain or recursion.
rows in rules will never be deleted from the rules table. When a replacement video becomes invalid, the id/type in rules will be updated. This way if 100 bad videos point to one good video, and that good video is taken down, it only takes one database entry update to point all the bad videos to another link. The unique property of replaceType/replaceId also helps reduce complexity.
The replacement video must be checked (with service provider API)before adding to make sure it will play.
This can be a little tricky/messy since the API calls go to another thread.
The bad video gets the omit flag.