Skip to content

Commit

Permalink
Merge branch 'development' into feature/playlist-2023-05
Browse files Browse the repository at this point in the history
* development:
  Bump webpack from 5.88.2 to 5.89.0 (FreeTubeApp#4168)
  Fix playlists not showing up on artist topic channels with the local API (FreeTubeApp#4129)
  Bump undici from 5.19.1 to 5.26.3 (FreeTubeApp#4173)
  Bump marked from 9.1.0 to 9.1.2 (FreeTubeApp#4171)
  Bump sass from 1.69.0 to 1.69.3 (FreeTubeApp#4169)
  Bump the eslint group with 2 updates (FreeTubeApp#4166)
  Bump the babel group with 2 updates (FreeTubeApp#4165)
  Truncate title of playlist in queue window (FreeTubeApp#4134)
  Wrap channel tabs as soon as there isn't enough screen space (FreeTubeApp#4139)
  Keep download folder path when changing to 'ask for download path' and back (FreeTubeApp#4101)
  Add external player support for Baka, Celluloid & Haruna (FreeTubeApp#4067)
  Fix error when clicking on the current quality in the DASH quality selector (FreeTubeApp#4130)
  • Loading branch information
PikachuEXE committed Oct 17, 2023
2 parents 1bf04e6 + a3b4207 commit 7dd6d97
Show file tree
Hide file tree
Showing 11 changed files with 245 additions and 196 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"autolinker": "^4.0.0",
"electron-context-menu": "^3.6.1",
"lodash.debounce": "^4.0.8",
"marked": "^9.1.0",
"marked": "^9.1.2",
"path-browserify": "^1.0.1",
"process": "^0.11.10",
"stylelint-use-logical-spec": "^5.0.0",
Expand All @@ -81,10 +81,10 @@
"youtubei.js": "^6.4.1"
},
"devDependencies": {
"@babel/core": "^7.23.0",
"@babel/core": "^7.23.2",
"@babel/eslint-parser": "^7.22.15",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/preset-env": "^7.22.20",
"@babel/preset-env": "^7.23.2",
"@double-great/stylelint-a11y": "^2.0.2",
"babel-loader": "^9.1.3",
"copy-webpack-plugin": "^11.0.0",
Expand All @@ -97,8 +97,8 @@
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsonc": "^2.10.0",
"eslint-plugin-n": "^16.1.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-n": "^16.2.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-unicorn": "^48.0.1",
"eslint-plugin-vue": "^9.17.0",
Expand All @@ -114,7 +114,7 @@
"postcss-scss": "^4.0.9",
"prettier": "^2.8.8",
"rimraf": "^5.0.5",
"sass": "^1.69.0",
"sass": "^1.69.3",
"sass-loader": "^13.3.2",
"stylelint": "^15.10.3",
"stylelint-config-sass-guidelines": "^10.0.0",
Expand All @@ -124,7 +124,7 @@
"vue-devtools": "^5.1.4",
"vue-eslint-parser": "^9.3.2",
"vue-loader": "^15.10.0",
"webpack": "^5.88.2",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
"yaml-eslint-parser": "^1.2.2"
Expand Down
15 changes: 7 additions & 8 deletions src/renderer/components/download-settings/download-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export default defineComponent({
},
data: function () {
return {
askForDownloadPath: false,
downloadBehaviorValues: [
'download',
'open'
Expand All @@ -32,6 +31,9 @@ export default defineComponent({
downloadPath: function() {
return this.$store.getters.getDownloadFolderPath
},
askForDownloadPath: function() {
return this.$store.getters.getDownloadAskPath
},
downloadBehaviorNames: function () {
return [
this.$t('Settings.Download Settings.Download in app'),
Expand All @@ -42,15 +44,9 @@ export default defineComponent({
return this.$store.getters.getDownloadBehavior
}
},
mounted: function () {
this.askForDownloadPath = this.downloadPath === ''
},
methods: {
handleDownloadingSettingChange: function (value) {
this.askForDownloadPath = value
if (value === true) {
this.updateDownloadFolderPath('')
}
this.updateDownloadAskPath(value)
},
chooseDownloadingFolder: async function() {
// only use with electron
Expand All @@ -59,9 +55,12 @@ export default defineComponent({
{ properties: ['openDirectory'] }
)

if (folder.canceled) return

this.updateDownloadFolderPath(folder.filePaths[0])
},
...mapActions([
'updateDownloadAskPath',
'updateDownloadFolderPath',
'updateDownloadBehavior'
])
Expand Down
3 changes: 3 additions & 0 deletions src/renderer/components/ft-video-player/ft-video-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,9 @@ export default defineComponent({
const VjsButton = videojs.getComponent('Button')
class dashQualitySelector extends VjsButton {
handleClick(event) {
if (!event.target.classList.contains('quality-item') && !event.target.classList.contains('vjs-menu-item-text')) {
return
}
const selectedQuality = event.target.innerText
const bitrate = selectedQuality === 'auto' ? 'auto' : parseInt(event.target.attributes.bitrate.value)
setDashQualityLevel(bitrate)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
.playlistTitle, .channelName {
.playlistTitle {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}

.playlistTitleLink, .channelName {
text-decoration: none;
color: inherit;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
<div
v-else
>
<h3>
<h3
class="playlistTitle"
:title="playlistTitle"
>
<router-link
class="playlistTitle"
class="playlistTitleLink"
:to="`/playlist/${playlistId}`"
>
{{ playlistTitle }}
Expand Down
1 change: 1 addition & 0 deletions src/renderer/store/modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ const state = {
videoPlaybackRateMouseScroll: false,
videoSkipMouseScroll: false,
videoPlaybackRateInterval: 0.25,
downloadAskPath: true,
downloadFolderPath: '',
downloadBehavior: 'download',
enableScreenshot: false,
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/store/modules/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,10 @@ const actions = {

const fileName = `${replaceFilenameForbiddenChars(title)}.${extension}`
const errorMessage = i18n.t('Downloading failed', { videoTitle: title })
const askFolderPath = rootState.settings.downloadAskPath
let folderPath = rootState.settings.downloadFolderPath

if (folderPath === '') {
if (askFolderPath) {
const options = {
defaultPath: fileName,
filters: [
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/views/Channel/Channel.css
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@

.tabs {
display: flex;
flex: 0 1 33%;
flex: 0 1 66%;
flex-wrap: wrap;
}

.tab {
Expand Down Expand Up @@ -201,7 +202,6 @@

.tabs {
flex: 1 1 0;
flex-wrap: wrap;
}

.tab {
Expand Down
9 changes: 8 additions & 1 deletion src/renderer/views/Channel/Channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -1191,13 +1191,20 @@ export default defineComponent({
// for the moment we just want the "Created Playlists" category that has all playlists in it

if (playlistsTab.content_type_filters.length > 1) {
let viewId = '1'

// Artist topic channels don't have any created playlists, so we went to select the "Albums & Singles" category instead
if (this.channelName.endsWith('- Topic') && channel.metadata.music_artist_name) {
viewId = '50'
}

/**
* @type {import('youtubei.js').YTNodes.ChannelSubMenu}
*/
const menu = playlistsTab.current_tab.content.sub_menu
const createdPlaylistsFilter = menu.content_type_sub_menu_items.find(contentType => {
const url = `https://youtube.com/${contentType.endpoint.metadata.url}`
return new URL(url).searchParams.get('view') === '1'
return new URL(url).searchParams.get('view') === viewId
}).title

playlistsTab = await playlistsTab.applyContentTypeFilter(createdPlaylistsFilter)
Expand Down
36 changes: 36 additions & 0 deletions static/external-player-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,41 @@
"playlistShuffle": null,
"playlistLoop": null
}
},
{
"name": "Celluloid",
"nameTranslationKey": "Settings.External Player Settings.Players.Celluloid.Name",
"value": "celluloid",
"cmdArguments": {
"defaultExecutable": "celluloid",
"defaultCustomArguments": null,
"supportsYtdlProtocol": false,
"videoUrl": "",
"playlistUrl": "",
"startOffset": "--mpv-start=",
"playbackRate": "--mpv-speed=",
"playlistIndex": "--mpv-playlist-start=",
"playlistReverse": null,
"playlistShuffle": "--mpv-shuffle",
"playlistLoop": "--mpv-loop-playlist"
}
},
{
"name": "Haruna",
"nameTranslationKey": "Settings.External Player Settings.Players.Haruna.Name",
"value": "haruna",
"cmdArguments": {
"defaultExecutable": "haruna",
"defaultCustomArguments": null,
"supportsYtdlProtocol": false,
"videoUrl": "",
"playlistUrl": "",
"startOffset": null,
"playbackRate": null,
"playlistIndex": null,
"playlistReverse": null,
"playlistShuffle": null,
"playlistLoop": null
}
}
]
Loading

0 comments on commit 7dd6d97

Please sign in to comment.