Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/development' into development
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/ISSUE_TEMPLATE/bug_report.yaml
#	package.json
#	yarn.lock
  • Loading branch information
MarmadileManteater committed Jun 15, 2023
2 parents 74715fd + efb0173 commit 98e2e3a
Show file tree
Hide file tree
Showing 41 changed files with 11,577 additions and 10,999 deletions.
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,54 +86,54 @@
"jintr-patch": "https://github.com/MarmadileManteater/Jinter.git#reorder-package-export-conditions"
},
"devDependencies": {
"@babel/core": "^7.22.1",
"@babel/eslint-parser": "^7.21.8",
"@babel/core": "^7.22.5",
"@babel/eslint-parser": "^7.22.5",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/preset-env": "^7.21.5",
"@babel/preset-env": "^7.22.5",
"@double-great/stylelint-a11y": "^2.0.2",
"babel-loader": "^9.1.2",
"copy-webpack-plugin": "^11.0.0",
"cordova": "^11.0.0",
"core-js": "^3.27.2",
"css-loader": "^6.7.4",
"css-loader": "^6.8.1",
"css-minimizer-webpack-plugin": "^5.0.0",
"electron": "^22.3.2",
"electron": "^22.3.12",
"electron-builder": "^23.6.0",
"eslint": "^8.41.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-config-standard": "^17.0.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsonc": "^2.8.0",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-unicorn": "^47.0.0",
"eslint-plugin-vue": "^9.13.0",
"eslint-plugin-vue": "^9.14.1",
"eslint-plugin-vuejs-accessibility": "^2.1.0",
"eslint-plugin-yml": "^1.7.0",
"html-webpack-plugin": "^5.5.1",
"html-webpack-plugin": "^5.5.3",
"js-yaml": "^4.1.0",
"json-minimizer-webpack-plugin": "^4.0.0",
"lefthook": "^1.4.0",
"lefthook": "^1.4.1",
"mini-css-extract-plugin": "^2.7.6",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.23",
"postcss": "^8.4.24",
"postcss-scss": "^4.0.6",
"prettier": "^2.8.8",
"rimraf": "^5.0.1",
"sass": "^1.62.1",
"sass-loader": "^13.2.2",
"sass": "^1.63.3",
"sass-loader": "^13.3.2",
"stylelint": "^14.16.1",
"stylelint-config-sass-guidelines": "^9.0.1",
"stylelint-config-standard": "^29.0.0",
"stylelint-high-performance-animation": "^1.8.0",
"tree-kill": "1.2.2",
"vue-devtools": "^5.1.4",
"vue-eslint-parser": "^9.3.0",
"vue-eslint-parser": "^9.3.1",
"vue-loader": "^15.10.0",
"webpack": "^5.83.1",
"webpack-cli": "^5.1.1",
"webpack-dev-server": "^4.15.0",
"webpack": "^5.86.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
"xml2js": "^0.4.23",
"yaml-eslint-parser": "^1.2.2"
}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/data-settings/data-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ export default defineComponent({

response.filePaths.forEach(filePath => {
if (filePath.endsWith('.db')) {
this.importFreeTubeSubscriptions(textDecode.split('\n'))
this.importFreeTubeHistory(textDecode.split('\n'))
} else if (filePath.endsWith('.json')) {
this.importYouTubeHistory(JSON.parse(textDecode))
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.groupTitle {
text-align: center;
}

@media only screen and (max-width: 800px) {
br.hide-on-mobile {
display: none;
Expand Down
146 changes: 92 additions & 54 deletions src/renderer/components/distraction-settings/distraction-settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,106 +2,156 @@
<ft-settings-section
:title="$t('Settings.Distraction Free Settings.Distraction Free Settings')"
>
<h4
class="groupTitle"
>
{{ $t('Settings.Distraction Free Settings.Sections.Side Bar') }}
</h4>
<div class="switchColumnGrid">
<div class="switchColumn">
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Video Views')"
:compact="true"
:default-value="hideVideoViews"
@change="updateHideVideoViews"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Video Likes And Dislikes')"
:label="$t('Settings.Distraction Free Settings.Hide Trending Videos')"
:compact="true"
:default-value="hideVideoLikesAndDislikes"
@change="updateHideVideoLikesAndDislikes"
:default-value="hideTrendingVideos"
@change="updateHideTrendingVideos"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Channel Subscribers')"
:label="$t('Settings.Distraction Free Settings.Hide Popular Videos')"
:compact="true"
:default-value="hideChannelSubscriptions"
@change="updateHideChannelSubscriptions"
:default-value="hidePopularVideos"
@change="updateHidePopularVideos"
/>
</div>
<div class="switchColumn">
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Comment Likes')"
:label="$t('Settings.Distraction Free Settings.Hide Playlists')"
:compact="true"
:default-value="hideCommentLikes"
@change="updateHideCommentLikes"
:default-value="hidePlaylists"
@change="updateHidePlaylists"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Active Subscriptions')"
:compact="true"
:default-value="hideActiveSubscriptions"
@change="updateHideActiveSubscriptions"
/>
</div>
</div>
<h4
class="groupTitle"
>
{{ $t('Settings.Distraction Free Settings.Sections.Channel Page') }}
</h4>
<div class="switchColumnGrid">
<div class="switchColumn">
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Video Description')"
:label="$t('Settings.Distraction Free Settings.Hide Channel Shorts')"
:compact="true"
:default-value="hideVideoDescription"
@change="updateHideVideoDescription"
:default-value="hideChannelShorts"
@change="updateHideChannelShorts"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Sharing Actions')"
:label="$t('Settings.Distraction Free Settings.Hide Channel Playlists')"
:compact="true"
:default-value="hideSharingActions"
@change="updateHideSharingActions"
:default-value="hideChannelPlaylists"
@change="updateHideChannelPlaylists"
/>
</div>
<div class="switchColumn">
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Chapters')"
:label="$t('Settings.Distraction Free Settings.Hide Channel Community')"
:compact="true"
:default-value="hideChapters"
@change="updateHideChapters"
:default-value="hideChannelCommunity"
@change="updateHideChannelCommunity"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Featured Channels')"
:compact="true"
:default-value="hideFeaturedChannels"
@change="updateHideFeaturedChannels"
/>
</div>
</div>
<h4
class="groupTitle"
>
{{ $t('Settings.Distraction Free Settings.Sections.Watch Page') }}
</h4>
<div class="switchColumnGrid">
<div class="switchColumn">
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Channel Playlists')"
:label="$t('Settings.Distraction Free Settings.Hide Video Likes And Dislikes')"
:compact="true"
:default-value="hideChannelPlaylists"
@change="updateHideChannelPlaylists"
:default-value="hideVideoLikesAndDislikes"
@change="updateHideVideoLikesAndDislikes"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Channel Shorts')"
:label="$t('Settings.Distraction Free Settings.Hide Chapters')"
:compact="true"
:default-value="hideChannelShorts"
@change="updateHideChannelShorts"
:default-value="hideChapters"
@change="updateHideChapters"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Video Description')"
:compact="true"
:default-value="hideVideoDescription"
@change="updateHideVideoDescription"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Comment Likes')"
:compact="true"
:default-value="hideCommentLikes"
@change="updateHideCommentLikes"
/>
</div>
<div class="switchColumn">
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Live Chat')"
:compact="true"
:default-value="hideLiveChat"
@change="updateHideLiveChat"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Recommended Videos')"
:compact="true"
:default-value="hideRecommendedVideos"
@change="handleHideRecommendedVideos"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Trending Videos')"
:label="$t('Settings.Distraction Free Settings.Hide Comments')"
:compact="true"
:default-value="hideTrendingVideos"
@change="updateHideTrendingVideos"
:default-value="hideComments"
@change="updateHideComments"
/>
</div>
</div>
<h4
class="groupTitle"
>
{{ $t('Settings.Distraction Free Settings.Sections.General') }}
</h4>
<div class="switchColumnGrid">
<div class="switchColumn">
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Popular Videos')"
:label="$t('Settings.Distraction Free Settings.Hide Video Views')"
:compact="true"
:default-value="hidePopularVideos"
@change="updateHidePopularVideos"
:default-value="hideVideoViews"
@change="updateHideVideoViews"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Playlists')"
:label="$t('Settings.Distraction Free Settings.Hide Channel Subscribers')"
:compact="true"
:default-value="hidePlaylists"
@change="updateHidePlaylists"
:default-value="hideChannelSubscriptions"
@change="updateHideChannelSubscriptions"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Live Chat')"
:label="$t('Settings.Distraction Free Settings.Hide Sharing Actions')"
:compact="true"
:default-value="hideLiveChat"
@change="updateHideLiveChat"
:default-value="hideSharingActions"
@change="updateHideSharingActions"
/>
</div>
<div class="switchColumn">
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Live Streams')"
:compact="true"
Expand All @@ -114,24 +164,12 @@
:default-value="hideUpcomingPremieres"
@change="updateHideUpcomingPremieres"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Comments')"
:compact="true"
:default-value="hideComments"
@change="updateHideComments"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Display Titles Without Excessive Capitalisation')"
:compact="true"
:default-value="showDistractionFreeTitles"
@change="updateShowDistractionFreeTitles"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Channel Community')"
:compact="true"
:default-value="hideChannelCommunity"
@change="updateHideChannelCommunity"
/>
</div>
</div>
<br class="hide-on-mobile">
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/ft-list-video/ft-list-video.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
@click="handleExternalPlayer"
/>
<ft-icon-button
v-if="!isLive"
v-if="!isUpcoming"
:title="$t('Video.Save Video')"
:icon="['fas', 'star']"
class="favoritesIcon"
Expand Down
21 changes: 19 additions & 2 deletions src/renderer/components/ft-video-player/ft-video-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ import { sponsorBlockSkipSegments } from '../../helpers/sponsorblock'
import { calculateColorLuminance, colors } from '../../helpers/colors'
import { pathExists } from '../../helpers/filesystem'
import { getPicturesPath, showSaveDialog, showToast } from '../../helpers/utils'
import { getProxyUrl } from '../../helpers/api/invidious'
import store from '../../store'

// YouTube now throttles if you use the `Range` header for the DASH formats, instead of the range query parameter
// videojs-http-streaming calls this hook everytime it makes a request,
// so we can use it to convert the Range header into the range query parameter for the streaming URLs
videojs.Vhs.xhr.beforeRequest = (options) => {
if (store.getters.getProxyVideos) {
const { uri } = options
options.uri = getProxyUrl(uri)
}
// pass in the optional base so it doesn't error for `dashFiles/videoId.xml` (DASH manifest in dev mode)
if (new URL(options.uri, window.location.origin).hostname.endsWith('.googlevideo.com')) {
// The official clients use POST requests with this body for the DASH requests, so we should do that too
Expand All @@ -34,7 +40,6 @@ videojs.Vhs.xhr.beforeRequest = (options) => {
}
}
}

// videojs-http-streaming spits out a warning every time you access videojs.Vhs.BANDWIDTH_VARIANCE
// so we'll get the value once here, to stop it spamming the console
// https://github.com/videojs/http-streaming/blob/main/src/config.js#L8-L10
Expand Down Expand Up @@ -304,6 +309,10 @@ export default defineComponent({

screenshotFolder: function() {
return this.$store.getters.getScreenshotFolderPath
},

proxyVideos: function () {
return this.$store.getters.getProxyVideos
}
},
watch: {
Expand Down Expand Up @@ -1224,7 +1233,15 @@ export default defineComponent({

this.useDash = false
this.useHls = false
this.activeSourceList = this.sourceList
this.activeSourceList = (this.proxyVideos || !process.env.IS_ELECTRON)
// use map here to return slightly different list without modifying original
? this.sourceList.map((source) => {
return {
...source,
url: getProxyUrl(source.url)
}
})
: this.sourceList

setTimeout(this.initializePlayer, 100)
},
Expand Down
Loading

0 comments on commit 98e2e3a

Please sign in to comment.