diff --git a/src/renderer/components/ft-list-video/ft-list-video.js b/src/renderer/components/ft-list-video/ft-list-video.js index 8f38e1b0..d1117955 100644 --- a/src/renderer/components/ft-list-video/ft-list-video.js +++ b/src/renderer/components/ft-list-video/ft-list-video.js @@ -202,6 +202,9 @@ export default Vue.extend({ // For Invidious data, as duration is sent in seconds calculateVideoDuration: function (lengthSeconds) { + if (typeof lengthSeconds === 'string') { + return lengthSeconds + } let durationText = '' let time = lengthSeconds let hours = 0 diff --git a/src/renderer/main.js b/src/renderer/main.js index a98d02be..45ce297b 100644 --- a/src/renderer/main.js +++ b/src/renderer/main.js @@ -25,22 +25,16 @@ Vue.use(VueI18n) // List of locales approved for use const activeLocales = ['en-US', 'de-DE', 'es-MX', 'fi', 'fr-FR', 'ja', 'pt-BR', 'pt-PT', 'ru', 'vi', 'zh-CN', 'zh-TW'] const messages = {} +const fileLocation = isDev ? 'static/locales/' : `${__dirname}/static/locales/` // Take active locales and load respective YAML file activeLocales.forEach((locale) => { try { // File location when running in dev - const doc = yaml.safeLoad(fs.readFileSync(`static/locales/${locale}.yaml`)) + const doc = yaml.safeLoad(fs.readFileSync(`${fileLocation}${locale}.yaml`)) messages[locale] = doc } catch (e) { console.log(e) - try { - // File location when compiled - const doc = yaml.safeLoad(fs.readFileSync(`${__dirname}/static/locales/${locale}.yaml`)) - messages[locale] = doc - } catch (e) { - console.log(e) - } } }) diff --git a/src/renderer/views/Playlist/Playlist.js b/src/renderer/views/Playlist/Playlist.js index 7a96add1..4cb4b6c3 100644 --- a/src/renderer/views/Playlist/Playlist.js +++ b/src/renderer/views/Playlist/Playlist.js @@ -92,7 +92,13 @@ export default Vue.extend({ infoSource: 'local' } - this.playlistItems = result.items + this.playlistItems = result.items.map((video) => { + video.videoId = video.id + video.lengthSeconds = video.duration + video.author = video.author.name + + return video + }) this.isLoading = false }).catch((err) => { diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index 9c4bac09..0ec03dc0 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -700,9 +700,8 @@ export default Vue.extend({ if (this.rememberHistory && !this.isLoading && !this.isLive) { const player = this.$refs.videoPlayer.player - if (typeof player !== 'undefined' && this.saveWatchedProgress) { + if (player !== null && this.saveWatchedProgress) { const currentTime = this.$refs.videoPlayer.player.currentTime() - console.log(currentTime) const payload = { videoId: this.videoId, watchProgress: currentTime