Skip to content

Commit

Permalink
* Remove unused video property paid
Browse files Browse the repository at this point in the history
  • Loading branch information
PikachuEXE committed Sep 13, 2023
1 parent b6f0354 commit 6cb55c8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
12 changes: 7 additions & 5 deletions src/renderer/components/data-settings/data-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,6 @@ export default defineComponent({
'description',
'isLive',
'lengthSeconds',
'paid',
'published',
'timeWatched',
'title',
Expand All @@ -719,6 +718,10 @@ export default defineComponent({
'lastViewedPlaylistId',
]

const ignoredKeys = [
'paid',
]

textDecode.forEach((history) => {
const historyData = JSON.parse(history)
// We would technically already be done by the time the data is parsed,
Expand All @@ -730,9 +733,10 @@ export default defineComponent({
Object.keys(historyData).forEach((key) => {
if (requiredKeys.includes(key) || optionalKeys.includes(key)) {
historyObject[key] = historyData[key]
} else {
} else if (!ignoredKeys.includes(key)) {
showToast(`Unknown data key: ${key}`)
}
// Else do not import the key
})

const historyObjectKeysSet = new Set(Object.keys(historyObject))
Expand Down Expand Up @@ -823,7 +827,6 @@ export default defineComponent({
historyObject.lengthSeconds = null
historyObject.watchProgress = 1
historyObject.isLive = false
historyObject.paid = false

this.updateHistory(historyObject)
}
Expand Down Expand Up @@ -897,8 +900,7 @@ export default defineComponent({
'lengthSeconds',
'timeAdded',
'isLive',
'paid',
'type'
'type',
]

playlists.forEach(async (playlistData) => {
Expand Down
4 changes: 1 addition & 3 deletions src/renderer/components/ft-list-video/ft-list-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ export default defineComponent({
watchProgress: 0,
timeWatched: new Date().getTime(),
isLive: false,
paid: false,
type: 'video'
}
this.updateHistory(videoData)
Expand Down Expand Up @@ -600,8 +599,7 @@ export default defineComponent({
lengthSeconds: this.data.lengthSeconds,
timeAdded: new Date().getTime(),
isLive: false,
paid: false,
type: 'video'
type: 'video',
}

const payload = {
Expand Down
3 changes: 1 addition & 2 deletions src/renderer/components/watch-video-info/watch-video-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,7 @@ export default defineComponent({
lengthSeconds: this.lengthSeconds,
timeAdded: new Date().getTime(),
isLive: false,
paid: false,
type: 'video'
type: 'video',
}

const payload = {
Expand Down
3 changes: 1 addition & 2 deletions src/renderer/views/Watch/Watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -999,8 +999,7 @@ export default defineComponent({
watchProgress: watchProgress,
timeWatched: new Date().getTime(),
isLive: false,
paid: false,
type: 'video'
type: 'video',
}

this.updateHistory(videoData)
Expand Down

0 comments on commit 6cb55c8

Please sign in to comment.