Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
adlerluiz committed Sep 1, 2020
1 parent 4d5c860 commit 9547c27
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 44 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

# Available for

<a href="https://repology.org/project/ytmdesktop/versions"><img src="https://repology.org/badge/vertical-allrepos/ytmdesktop.svg" alt="Packaging status" align="right"></a>

## Windows

- Winget: ```winget install "YouTube Music Desktop App"``` or ```winget install Ytmdesktop.Ytmdesktop```
Expand Down
9 changes: 9 additions & 0 deletions electron-builder-deploy64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ appId: app.ytmd

files:
- '**/*'
- "!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}"
- "!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}"
- "!**/node_modules/*.d.ts"
- "!**/node_modules/.bin"
- "!**/*.{iml,o,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,xproj}"
- "!**/._*"
- "!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,.gitignore,.gitattributes}"
- "!**/{__pycache__,thumbs.db,.flowconfig,.idea,.vs,.nyc_output}"
- "!**/{npm-debug.log,yarn.lock,.yarn-integrity,.yarn-metadata.json}"
- '!LICENSE.md'
- '!CODE_OF_CONDUCT.md'
- '!CONTRIBUTING.md'
Expand Down
9 changes: 9 additions & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ appId: app.ytmd

files:
- '**/*'
- "!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}"
- "!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}"
- "!**/node_modules/*.d.ts"
- "!**/node_modules/.bin"
- "!**/*.{iml,o,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,xproj}"
- "!**/._*"
- "!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,.gitignore,.gitattributes}"
- "!**/{__pycache__,thumbs.db,.flowconfig,.idea,.vs,.nyc_output}"
- "!**/{npm-debug.log,yarn.lock,.yarn-integrity,.yarn-metadata.json}"
- '!LICENSE.md'
- '!CODE_OF_CONDUCT.md'
- '!CONTRIBUTING.md'
Expand Down
9 changes: 9 additions & 0 deletions electron-builder64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ appId: app.ytmd

files:
- '**/*'
- "!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}"
- "!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}"
- "!**/node_modules/*.d.ts"
- "!**/node_modules/.bin"
- "!**/*.{iml,o,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,xproj}"
- "!**/._*"
- "!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,.gitignore,.gitattributes}"
- "!**/{__pycache__,thumbs.db,.flowconfig,.idea,.vs,.nyc_output}"
- "!**/{npm-debug.log,yarn.lock,.yarn-integrity,.yarn-metadata.json}"
- '!LICENSE.md'
- '!CODE_OF_CONDUCT.md'
- '!CONTRIBUTING.md'
Expand Down
56 changes: 14 additions & 42 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1141,38 +1141,6 @@ function createWindow() {
)
)

switch (settingsProvider.get('settings-miniplayer-size')) {
case '1':
miniplayer.setSize(170, 170)
settingsProvider.set('settings-miniplayer-size', 170)
break

case '2':
miniplayer.setSize(200, 200)
settingsProvider.set('settings-miniplayer-size', 200)
break

case '3':
miniplayer.setSize(230, 230)
settingsProvider.set('settings-miniplayer-size', 230)
break

case '4':
miniplayer.setSize(260, 260)
settingsProvider.set('settings-miniplayer-size', 260)
break

case '5':
miniplayer.setSize(290, 290)
settingsProvider.set('settings-miniplayer-size', 290)
break

case '6':
miniplayer.setSize(320, 320)
settingsProvider.set('settings-miniplayer-size', 320)
break
}

let miniplayerPosition = settingsProvider.get('miniplayer-position')
if (miniplayerPosition != undefined) {
miniplayer.setPosition(
Expand All @@ -1197,17 +1165,21 @@ function createWindow() {

let storeMiniplayerSizeTimer
miniplayer.on('resize', function (e) {
let size = miniplayer.getSize()
if (storeMiniplayerSizeTimer) {
clearTimeout(storeMiniplayerSizeTimer)
try {
let size = miniplayer.getSize()
if (storeMiniplayerSizeTimer) {
clearTimeout(storeMiniplayerSizeTimer)
}
storeMiniplayerSizeTimer = setTimeout(() => {
settingsProvider.set(
'settings-miniplayer-size',
Math.min(...size)
)
miniplayer.setSize(Math.min(...size), Math.min(...size))
}, 500)
} catch {
writeLog({ type: 'warn', data: 'error miniplayer resize' })
}
storeMiniplayerSizeTimer = setTimeout(() => {
settingsProvider.set(
'settings-miniplayer-size',
Math.min(...size)
)
miniplayer.setSize(Math.min(...size), Math.min(...size))
}, 500)
})

mainWindow.hide()
Expand Down
7 changes: 5 additions & 2 deletions src/pages/settings/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ if (elementRangeSkipTrackShorterThan) {
elementRangeSkipTrackShorterThan.addEventListener('input', function () {
document.getElementById(
'range-skip-track-shorter-than-value'
).innerText = this.value
).innerText = this.value == 0 ? `(Disabled) ${this.value}` : this.value
settingsProvider.set('settings-skip-track-shorter-than', this.value)
})
}
Expand Down Expand Up @@ -342,7 +342,10 @@ function loadSettings() {
).value = settingsSkipTrackShorterThan
document.getElementById(
'range-skip-track-shorter-than-value'
).innerText = settingsSkipTrackShorterThan
).innerText =
settingsSkipTrackShorterThan == 0
? `(Disabled) ${settingsSkipTrackShorterThan}`
: settingsSkipTrackShorterThan
}

document.getElementById('app-version').innerText = remote.app.getVersion()
Expand Down

0 comments on commit 9547c27

Please sign in to comment.