From dd5f44911f8750e61e0644324212218f2c2ea17c Mon Sep 17 00:00:00 2001 From: Jean van Kasteel Date: Tue, 12 Nov 2024 00:41:01 +0100 Subject: [PATCH] standard:fix --- app/js/lib/cast.js | 10 +++++----- app/js/main/details.js | 2 +- app/js/main/stats.js | 10 +++++----- app/js/utils/themes.js | 2 +- gulpfile.js | 5 +++-- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/app/js/lib/cast.js b/app/js/lib/cast.js index 04a29f2..5b2bb3c 100644 --- a/app/js/lib/cast.js +++ b/app/js/lib/cast.js @@ -10,14 +10,14 @@ const Cast = { // DLNA Cast.clients.dlna = Dlnacasts() Cast.clients.dlna.on('update', player => { - //console.info('Found DLNA Device: %s at %s', player.name, player.host) + // console.info('Found DLNA Device: %s at %s', player.name, player.host) let exists = false for (const i in Cast.players) { if (Cast.players[i].name === player.name) { exists = true console.info('Updating the available players list with %s (%s)', player.name, player.host) Cast.players[i] = { - name: player.name, + name: player.name, url: player.host, player: player } @@ -43,11 +43,11 @@ const Cast = { for (const i in Cast.players) { if (Cast.players[i].name === name) { const player = Cast.players[i].player - let media = { + const media = { title: title, dlnaFeatures: 'DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01100000000000000000000000000000' } - if (subtitle) media.subtitte = [subtitle] + if (subtitle) media.subtitle = [subtitle] player.play(url, media, (err, status) => { if (err) { Cast.activePlayer = undefined @@ -77,4 +77,4 @@ const Cast = { Cast.activePlayer = undefined } } -} \ No newline at end of file +} diff --git a/app/js/main/details.js b/app/js/main/details.js index 4644820..4ac919b 100644 --- a/app/js/main/details.js +++ b/app/js/main/details.js @@ -719,7 +719,7 @@ const Details = { const item = `
` + `${Cast.players[i].name}` + `${Cast.players[i].url}` + - `
` + '' $('#keepWatching .selector .list').append(item) } $('#keepWatching').show() diff --git a/app/js/main/stats.js b/app/js/main/stats.js index 67cf9dc..78da1d1 100644 --- a/app/js/main/stats.js +++ b/app/js/main/stats.js @@ -33,22 +33,22 @@ const Stats = { $('#stats #stotaltimemovies').text(Misc.secsToYDHM(stats.movies.minutes * 60)) $('#stats #stotalmovies').text(Number(stats.movies.watched).toLocaleString()) - //chart + // chart const distribution = [] const average = (() => { let total = 0 let numtotal = 0 for (const i in stats.ratings.distribution) { - total += stats.ratings.distribution[i]*i + total += stats.ratings.distribution[i] * i numtotal += stats.ratings.distribution[i] distribution.push(stats.ratings.distribution[i]) } - return (total/numtotal).toFixed(1) + return (total / numtotal).toFixed(1) })() $('#sratings h4').text(i18n.__('%s ratings with an average of %s hearts.', stats.ratings.total, average)) - + const ctx = $('#schartratings') - new Chart(ctx, { + const chart = new Chart(ctx, { type: 'bar', data: { labels: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'], diff --git a/app/js/utils/themes.js b/app/js/utils/themes.js index fd07823..bdc62c1 100644 --- a/app/js/utils/themes.js +++ b/app/js/utils/themes.js @@ -4,7 +4,7 @@ const Themes = { setup: () => { // apply style at startup Themes.apply(DB.sync.get('theme')) - + // build settings dropdown & import stylesheets fs.readdir('./app/css/themes', (err, files = []) => { if (err) console.error(err) diff --git a/gulpfile.js b/gulpfile.js index 3583167..7b65590 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -396,7 +396,7 @@ const sd = (fix) => { return new Promise((resolve, reject) => { standard.lintFiles('**/*.js', { fix: fix, - ignore: ['dist', 'app/vendor', 'build', 'cache'], + ignore: ['dist', 'app/js/vendor', 'build', 'cache'], globals: [ // App 'crypt', @@ -474,7 +474,8 @@ const sd = (fix) => { 'event', 'Image', 'screen', - 'countryList' + 'countryList', + 'Chart' ] }, (error, res) => { if (error) return reject(error)