Merge pull request #902 from GilgusMaximus/development

Added check for duplicate in YouTube JSON file
This commit is contained in:
Luca Hohmann 2020-12-30 20:50:52 +01:00 committed by GitHub
commit c9c1e4c3e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

1
.gitignore vendored
View File

@ -20,3 +20,4 @@ coverage
__coverage__
csak-timelog.json
.idea/
debug/

View File

@ -265,7 +265,11 @@ export default Vue.extend({
return sub.id === subscription.id || sub.name === subscription.name
})
if (subExists === -1) {
const subDuplicateExists = subscriptions.findIndex((sub) => {
return sub.id === subscription.id || sub.name === subscription.name
})
if (subExists === -1 && subDuplicateExists === -1) {
subscriptions.push(subscription)
}