Skip to content

Commit

Permalink
standard:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vankasteelj committed Nov 11, 2024
1 parent 3bef277 commit dd5f449
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
10 changes: 5 additions & 5 deletions app/js/lib/cast.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand Down Expand Up @@ -77,4 +77,4 @@ const Cast = {
Cast.activePlayer = undefined
}
}
}
}
2 changes: 1 addition & 1 deletion app/js/main/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ const Details = {
const item = `<div class="peer" onClick="Details.keepWatchingDlna(Cast.players[${i}])">` +
`<span class="name">${Cast.players[i].name}</span>` +
`<span class="ip">${Cast.players[i].url}</span>` +
`</div>`
'</div>'
$('#keepWatching .selector .list').append(item)
}
$('#keepWatching').show()
Expand Down
10 changes: 5 additions & 5 deletions app/js/main/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
2 changes: 1 addition & 1 deletion app/js/utils/themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -474,7 +474,8 @@ const sd = (fix) => {
'event',
'Image',
'screen',
'countryList'
'countryList',
'Chart'
]
}, (error, res) => {
if (error) return reject(error)
Expand Down

0 comments on commit dd5f449

Please sign in to comment.