Skip to content

Commit a003d4b

Browse files
**Release 110**
commit 79030b4 Author: Emma <[email protected]> Date: Fri Feb 23 21:54:42 2024 -0500 bump version number commit 28803d1 Author: Emma <[email protected]> Date: Fri Feb 23 21:45:13 2024 -0500 Update yarn lock commit e517085 Merge: dafd7ab 979683c Author: Emma <[email protected]> Date: Fri Feb 23 18:40:03 2024 -0500 Merge branch 'development' of https://github.com/MarmadileManteater/FreeTubeCordova into development ... **Full Changelog**: 0.19.1.109...0.19.2.110
2 parents 0d8481c + 79030b4 commit a003d4b

File tree

18 files changed

+479
-255
lines changed

18 files changed

+479
-255
lines changed

.github/workflows/linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Linter
66
# events but only for the master branch
77
on:
88
pull_request:
9-
branches: [ master, development ]
9+
branches: [ master, development, '**-RC' ]
1010

1111
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1212
jobs:

_scripts/webpack.cordova.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ const config = {
131131
}),
132132
new webpack.ProvidePlugin({
133133
process: 'process/browser',
134-
Buffer: ['buffer', 'Buffer'],
134+
Buffer: ['buffer', 'Buffer']
135135
}),
136136
new HtmlWebpackPlugin({
137137
excludeChunks: ['processTaskWorker'],
@@ -154,7 +154,8 @@ const config = {
154154
// video.js's mpd-parser uses @xmldom/xmldom so that it can support both node and web browsers
155155
// As FreeTube only runs in electron and web browsers, we can use the native DOMParser class, instead of the "polyfill"
156156
// https://caniuse.com/mdn-api_domparser
157-
'@xmldom/xmldom$': path.resolve(__dirname, '_domParser.js')
157+
'@xmldom/xmldom$': path.resolve(__dirname, '_domParser.js'),
158+
'localforage': path.resolve(__dirname, "../src/cordova/localforage.js")
158159
},
159160
fallback: {
160161
'fs/promises': path.resolve(__dirname, '_empty.js'),

jsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"vueCompilerOptions": {
33
"target": 2.7
4+
},
5+
"compilerOptions": {
6+
"strictNullChecks": true
47
}
58
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "freetube",
33
"productName": "FreeTube",
44
"description": "A private YouTube client",
5-
"version": "0.19.1",
5+
"version": "0.19.2",
66
"license": "AGPL-3.0-or-later",
77
"main": "./dist/main.js",
88
"private": true,
@@ -84,7 +84,7 @@
8484
"vue-router": "^3.6.5",
8585
"vue-tiny-slider": "^0.1.39",
8686
"vuex": "^3.6.2",
87-
"youtubei.js": "^6.4.1",
87+
"youtubei.js": "^9.1",
8888
"jintr-patch": "https://github.com/LuanRT/Jinter.git"
8989
},
9090
"devDependencies": {

src/cordova/localforage.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import localforage from '../../node_modules/localforage/dist/localforage'
2+
import { requestDirectory, readFromFile, writeToFile } from '../renderer/helpers/cordova'
3+
4+
export function createInstance(kwargs) {
5+
const instance = localforage.createInstance(kwargs)
6+
return {
7+
async getItem(key) {
8+
const fs = await requestDirectory()
9+
const data = await readFromFile(fs, key)
10+
// if the data is empty, fallback to localstorage
11+
if (data === '') return instance.getItem(key)
12+
// if not, return the data
13+
return data
14+
},
15+
async setItem(key, value) {
16+
const fs = await requestDirectory()
17+
await writeToFile(fs, key, value)
18+
}
19+
}
20+
}

src/renderer/components/channel-about/channel-about.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export default defineComponent({
2424
type: Number,
2525
default: null
2626
},
27+
videos: {
28+
type: Number,
29+
default: null
30+
},
2731
location: {
2832
type: String,
2933
default: null
@@ -61,5 +65,9 @@ export default defineComponent({
6165
formattedViews: function () {
6266
return formatNumber(this.views)
6367
},
68+
69+
formattedVideos: function () {
70+
return formatNumber(this.videos)
71+
},
6472
}
6573
})

src/renderer/components/channel-about/channel-about.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/>
1313
</template>
1414
<template
15-
v-if="joined || views !== null || location"
15+
v-if="joined || views !== null || videos !== null || location"
1616
>
1717
<h2>{{ $t('Channel.About.Details') }}</h2>
1818
<table
@@ -38,6 +38,16 @@
3838
</th>
3939
<td>{{ formattedViews }}</td>
4040
</tr>
41+
<tr
42+
v-if="videos !== null"
43+
>
44+
<th
45+
scope="row"
46+
>
47+
{{ $t('Global.Videos') }}
48+
</th>
49+
<td>{{ formattedVideos }}</td>
50+
</tr>
4151
<tr
4252
v-if="location"
4353
>

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export default defineComponent({
6464
viewCount: 0,
6565
parsedViewCount: '',
6666
uploadedTime: '',
67+
lengthSeconds: 0,
6768
duration: '',
6869
description: '',
6970
watched: false,
@@ -156,7 +157,11 @@ export default defineComponent({
156157
},
157158

158159
progressPercentage: function () {
159-
return (this.watchProgress / this.data.lengthSeconds) * 100
160+
if (typeof this.lengthSeconds !== 'number') {
161+
return 0
162+
}
163+
164+
return (this.watchProgress / this.lengthSeconds) * 100
160165
},
161166

162167
hideSharingActions: function() {
@@ -445,9 +450,11 @@ export default defineComponent({
445450
this.channelName = this.data.author ?? null
446451
this.channelId = this.data.authorId ?? null
447452

448-
if (this.data.isRSS && this.historyEntryExists) {
453+
if ((this.data.lengthSeconds === '' || this.data.lengthSeconds === '0:00') && this.historyEntryExists) {
454+
this.lengthSeconds = this.historyEntry.lengthSeconds
449455
this.duration = formatDurationAsTimestamp(this.historyEntry.lengthSeconds)
450456
} else {
457+
this.lengthSeconds = this.data.lengthSeconds
451458
this.duration = formatDurationAsTimestamp(this.data.lengthSeconds)
452459
}
453460

src/renderer/components/ft-list-video/ft-list-video.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
>
2929
</router-link>
3030
<div
31-
v-if="isLive || duration !== '0:00'"
31+
v-if="isLive || isUpcoming || (duration !== '' && duration !== '0:00')"
3232
class="videoDuration"
3333
:class="{
3434
live: isLive,

src/renderer/helpers/api/invidious.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ export async function generateInvidiousDashManifestLocally(formats, invidiousIns
370370

371371
return await FormatUtils.toDash({
372372
adaptive_formats: formats
373-
}, urlTransformer, undefined, undefined, player)
373+
}, false, urlTransformer, undefined, undefined, player)
374374
}
375375

376376
export function convertInvidiousToLocalFormat(format) {

0 commit comments

Comments
 (0)