Skip to content

Commit e202c79

Browse files
Merge branch 'upstream_development' into development
# Conflicts: # .github/workflows/no-response.yml # yarn.lock
2 parents aa3ab5a + 15d2cbb commit e202c79

File tree

15 files changed

+250
-153
lines changed

15 files changed

+250
-153
lines changed

.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ module.exports = {
3838
'no-console': ['error', { allow: ['warn', 'error'] }],
3939
'no-unused-vars': 'warn',
4040
'no-undef': 'warn',
41-
'vue/no-template-key': 'warn'
41+
'vue/no-template-key': 'warn',
42+
'vue/no-useless-template-attributes': 'off',
43+
'vue/multi-word-component-names': 'off'
4244
}
4345
}

.github/workflows/no-response.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ jobs:
2020
This issue has been automatically closed because there has been no response to our request for more information from the original author.
2121
With only the information that is currently in the issue, we don't have enough information to take action.
2222
Please reach out if you have or find the answers we need so that we can investigate further.
23-
daysUntilClose: 21
23+
daysUntilClose: 14
2424
responseRequiredLabel: "U: Waiting for Response from Author"

.github/workflows/stale.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: 'Close stale issues and PRs'
2+
on:
3+
schedule:
4+
- cron: '30 1 * * *'
5+
6+
jobs:
7+
stale:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/stale@v6
11+
with:
12+
stale-issue-message: 'This issue is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
13+
stale-pr-message: 'This PR is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 14 days.'
14+
close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.'
15+
close-pr-message: 'This PR was closed because it has been stalled for 14 days with no activity.'
16+
days-before-issue-stale: 28
17+
days-before-pr-stale: 28
18+
days-before-issue-close: 7
19+
days-before-pr-close: 14
20+
stale-issue-label: 'U: stale'
21+
stale-pr-label: 'PR: stale'

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@
6262
"electron-context-menu": "^3.5.0",
6363
"http-proxy-agent": "^4.0.1",
6464
"https-proxy-agent": "^5.0.0",
65-
"jquery": "^3.6.0",
6665
"lodash.debounce": "^4.0.8",
6766
"lodash.isequal": "^4.5.0",
6867
"marked": "^4.0.17",
69-
"nedb-promises": "^5.0.1",
68+
"nedb-promises": "^6.2.1",
7069
"opml-to-json": "^1.0.1",
7170
"process": "^0.11.10",
7271
"rss-parser": "^3.12.0",
@@ -109,7 +108,7 @@
109108
"eslint-plugin-prettier": "^4.2.1",
110109
"eslint-plugin-promise": "^5.1.0",
111110
"eslint-plugin-standard": "^5.0.0",
112-
"eslint-plugin-vue": "^7.17.0",
111+
"eslint-plugin-vue": "^9.6.0",
113112
"html-webpack-plugin": "^5.3.2",
114113
"js-yaml": "^4.1.0",
115114
"json-minimizer-webpack-plugin": "^4.0.0",
@@ -123,7 +122,7 @@
123122
"style-loader": "^3.2.1",
124123
"tree-kill": "1.2.2",
125124
"vue-devtools": "^5.1.4",
126-
"vue-eslint-parser": "^7.10.0",
125+
"vue-eslint-parser": "^9.1.0",
127126
"vue-loader": "^15.10.0",
128127
"vue-style-loader": "^4.1.3",
129128
"webpack": "^5.74.0",

src/renderer/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ export default Vue.extend({
315315
},
316316

317317
openAllLinksExternally: function () {
318-
const isExternalLink = (event) => event.target.tagName === 'A' && event.target.href.startsWith('http')
318+
const isExternalLink = (event) => event.target.tagName === 'A' && !event.target.href.startsWith(window.location.origin)
319319

320320
document.addEventListener('click', (event) => {
321321
if (isExternalLink(event)) {

src/renderer/components/ft-toast/ft-toast.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default Vue.extend({
2828
open: function (message, action, time) {
2929
const toast = { message: message, action: action || (() => { }), isOpen: false, timeout: null }
3030
toast.timeout = setTimeout(this.close, time || 3000, toast)
31-
setImmediate(() => { toast.isOpen = true })
31+
setTimeout(() => { toast.isOpen = true })
3232
if (this.toasts.length > 4) {
3333
this.remove(0)
3434
}

src/renderer/components/ft-video-player/ft-video-player.js

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import 'videojs-contrib-quality-levels'
1313
import 'videojs-http-source-selector'
1414

1515
import { IpcChannels } from '../../../constants'
16+
import { sponsorBlockSkipSegments } from '../../helpers/sponsorblock'
1617

1718
export default Vue.extend({
1819
name: 'FtVideoPlayer',
@@ -547,32 +548,30 @@ export default Vue.extend({
547548
},
548549

549550
initializeSponsorBlock() {
550-
this.sponsorBlockSkipSegments({
551-
videoId: this.videoId,
552-
categories: this.sponsorSkips.seekBar
553-
}).then((skipSegments) => {
554-
if (skipSegments.length === 0) {
555-
return
556-
}
551+
sponsorBlockSkipSegments(this.videoId, this.sponsorSkips.seekBar)
552+
.then((skipSegments) => {
553+
if (skipSegments.length === 0) {
554+
return
555+
}
557556

558-
this.player.ready(() => {
559-
this.player.on('timeupdate', () => {
560-
this.skipSponsorBlocks(skipSegments)
561-
})
557+
this.player.ready(() => {
558+
this.player.on('timeupdate', () => {
559+
this.skipSponsorBlocks(skipSegments)
560+
})
562561

563-
skipSegments.forEach(({
564-
category,
565-
segment: [startTime, endTime]
566-
}) => {
567-
this.addSponsorBlockMarker({
568-
time: startTime,
569-
duration: endTime - startTime,
570-
color: 'var(--primary-color)',
571-
category: category
562+
skipSegments.forEach(({
563+
category,
564+
segment: [startTime, endTime]
565+
}) => {
566+
this.addSponsorBlockMarker({
567+
time: startTime,
568+
duration: endTime - startTime,
569+
color: 'var(--primary-color)',
570+
category: category
571+
})
572572
})
573573
})
574574
})
575-
})
576575
},
577576

578577
skipSponsorBlocks(skipSegments) {
@@ -1927,7 +1926,6 @@ export default Vue.extend({
19271926
'calculateColorLuminance',
19281927
'updateDefaultCaptionSettings',
19291928
'showToast',
1930-
'sponsorBlockSkipSegments',
19311929
'parseScreenshotCustomFileName',
19321930
'updateScreenshotFolderPath',
19331931
'getPicturesPath',

src/renderer/helpers/sponsorblock.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import store from '../store/index'
2+
3+
export async function sponsorBlockSkipSegments(videoId, categories) {
4+
const videoIdBuffer = new TextEncoder().encode(videoId)
5+
6+
const hashBuffer = await crypto.subtle.digest('SHA-256', videoIdBuffer)
7+
const hashArray = Array.from(new Uint8Array(hashBuffer))
8+
9+
const videoIdHashPrefix = hashArray
10+
.map(byte => byte.toString(16).padStart(2, '0'))
11+
.slice(0, 4)
12+
.join('')
13+
14+
const requestUrl = `${store.getters.getSponsorBlockUrl}/api/skipSegments/${videoIdHashPrefix}?categories=${JSON.stringify(categories)}`
15+
16+
try {
17+
const response = await fetch(requestUrl)
18+
19+
// 404 means that there are no segments registered for the video
20+
if (response.status === 404) {
21+
return []
22+
}
23+
24+
const json = await response.json()
25+
return json
26+
.filter((result) => result.videoID === videoId)
27+
.flatMap((result) => result.segments)
28+
} catch (error) {
29+
console.error('failed to fetch SponsorBlock segments', requestUrl, error)
30+
throw error
31+
}
32+
}

src/renderer/store/modules/invidious.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@ import fs from 'fs'
22

33
const state = {
44
currentInvidiousInstance: '',
5-
invidiousInstancesList: null,
6-
isGetChannelInfoRunning: false
5+
invidiousInstancesList: null
76
}
87

98
const getters = {
10-
getIsGetChannelInfoRunning(state) {
11-
return state.isGetChannelInfoRunning
12-
},
13-
149
getCurrentInvidiousInstance(state) {
1510
return state.currentInvidiousInstance
1611
},
@@ -98,8 +93,6 @@ const actions = {
9893

9994
invidiousGetChannelInfo({ commit, dispatch }, channelId) {
10095
return new Promise((resolve, reject) => {
101-
commit('toggleIsGetChannelInfoRunning')
102-
10396
const payload = {
10497
resource: 'channels',
10598
id: channelId,
@@ -110,7 +103,6 @@ const actions = {
110103
resolve(response)
111104
}).catch((xhr) => {
112105
console.error(xhr)
113-
commit('toggleIsGetChannelInfoRunning')
114106
reject(xhr)
115107
})
116108
})
@@ -122,7 +114,6 @@ const actions = {
122114
resolve(response)
123115
}).catch((xhr) => {
124116
console.error(xhr)
125-
commit('toggleIsGetChannelInfoRunning')
126117
reject(xhr)
127118
})
128119
})
@@ -147,10 +138,6 @@ const actions = {
147138
}
148139

149140
const mutations = {
150-
toggleIsGetChannelInfoRunning(state) {
151-
state.isGetChannelInfoRunning = !state.isGetChannelInfoRunning
152-
},
153-
154141
setCurrentInvidiousInstance(state, value) {
155142
state.currentInvidiousInstance = value
156143
},

src/renderer/store/modules/sponsorblock.js

Lines changed: 0 additions & 55 deletions
This file was deleted.

src/renderer/videoJS.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,3 +2221,13 @@ video::-webkit-media-text-track-display {
22212221
height: 100%;
22222222
}
22232223
}
2224+
2225+
@media screen and (max-width: 680px) {
2226+
.vjs-control.vjs-disabled.vjs-picture-in-picture-control,
2227+
.vjs-control.vjs-button.vjs-button-fullwindow {
2228+
display: none;
2229+
}
2230+
.vjs-full-window .video-js.vjs-full-screen .vjs-control.vjs-button.vjs-button-fullwindow {
2231+
display: initial;
2232+
}
2233+
}

static/locales/cs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ Video:
673673
OpeningTemplate: Otevřít $ v %...
674674
video: video
675675
OpenInTemplate: Otevřít v $
676-
Premieres on: Premiéry zapnuty
676+
Premieres on: Premiéra
677677
Stats:
678678
Mimetype: Typ int. média
679679
Video statistics are not available for legacy videos: Statistiky videí nejsou
@@ -748,7 +748,7 @@ Comments:
748748
Click to View Comments: 'Kliknutím zobrazíte komentáře'
749749
Getting comment replies, please wait: 'Dostáváte odpovědi na komentář, počkejte
750750
prosím'
751-
There are no more comments for this video: 'K tomuto videu nejsou žádné další komentáře'
751+
There are no more comments for this video: 'U tohoto videa nejsou žádné další komentáře'
752752
Show Comments: 'Zobrazit komentáře'
753753
Hide Comments: 'Skrýt komentáře'
754754
Sort by: 'Seřadit podle'

static/locales/fi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Subscriptions:
7676
profiililla on paljon tilauksia. Pakotetaan RSS nopeuden rajoittamisen välttämiseksi
7777
Load More Videos: Lataa lisää videoita
7878
Error Channels: Kanavat, joissa on virheitä
79+
Empty Channels: Tilaamillasi kanavilla ei ole videoita tällä hetkellä.
7980
Trending:
8081
Trending: 'Nousussa'
8182
Trending Tabs: Nousussa olevat välilehdet
@@ -269,6 +270,7 @@ Settings:
269270
Export Subscriptions: 'Vie tilauksia'
270271
How do I import my subscriptions?: 'Miten voin tuoda tilaukseni?'
271272
Fetch Feeds from RSS: Nouda RSS-syöte
273+
Fetch Automatically: Nouda syöte automaattisesti
272274
Advanced Settings:
273275
Advanced Settings: 'Lisäasetukset'
274276
Enable Debug Mode (Prints data to the console): 'Ota virheenkorjaustila käyttöön
@@ -371,6 +373,7 @@ Settings:
371373
Hide Video Description: Piilota videon kuvaus
372374
Hide Live Streams: Piilota suorat lähetykset
373375
Hide Sharing Actions: Piilota jakamistoiminnot
376+
Hide Chapters: Piilota kappaleet
374377
The app needs to restart for changes to take effect. Restart and apply change?: Sovellus
375378
on käynnistettävä uudelleen, jotta muutokset tulevat voimaan. Käynnistetäänkö
376379
uudelleen?
@@ -564,6 +567,7 @@ Video:
564567
Minutes: Minuuttia
565568
Minute: Minuutti
566569
Less than a minute: Vähemmän kuin minuutti
570+
In less than a minute: Alle minuutin kuluessa
567571
Published on: 'Julkaistu'
568572
# $ is replaced with the number and % with the unit (days, hours, minutes...)
569573
Publicationtemplate: '$ % sitten'
@@ -876,3 +880,5 @@ Channels:
876880
Unsubscribe: Peruuta tilaus
877881
Unsubscribe Prompt: Oletko varma että haluat peruuttaa tilauksen kanavalle ”$”?
878882
Unsubscribed: $ on poistettu tilauksistasi
883+
Clipboard:
884+
Copy failed: Kopiointi leikepöydälle epäonnistui

0 commit comments

Comments
 (0)