Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Genz translation #172

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@
/semantic/gulpfile.js

.env

# yalc is used for developing and testing electron-builder but we don't need the files
.yalc
yalc.lock
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ It retrieves audio, video and metadata from various Internet sources, such as:
- Italiano ([@ZinRicky](https://github.com/ZinRicky), [@filipporomani](https://github.com/filipporomani))
- 日本語 ([@xyloflake](https://github.com/xyloflake))
- Русский ([@staniel359](https://github.com/staniel359))
- Gen Z ([@xyloflake](https://github.com/xyloflake), [@gamersi](https://github.com/gamersi))

### Technical stack

Expand Down
18 changes: 9 additions & 9 deletions docs/guides/connections/spotify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,43 @@ This section describes how to generate them.
1. **Navigate to the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard)**
2. **Click on "Create App" button.** The button to be clicked is surrounded by a red box.

![alt text](images/img_1.png)
![alt text](images/img_01.png)

You will now see this:

![alt text](images/img_2.png)
![alt text](images/img_02.png)
3. **Fill the details.** We use a random name for "App Name" field, a random description. Here, I'm using the name "muf" for the "App Name" and the description "Some desc" for the description.

You should now end up with this

![alt text](images/img_3.png)
![alt text](images/img_03.png)
4. **This is a very important step.**

In the Redirect URI field, paste the following:
```
https://178-79-138-81.ip.linodeusercontent.com/code
```

![alt text](images/img_4.png)
![alt text](images/img_04.png)

You will finally end up with

![alt text](images/img_5.png)
![alt text](images/img_05.png)
5. **Check "I understand and agree with Spotify's Developer Terms of Service and Design Guidelines," then click "Save".** Congratulations! You have now created your Spotify App.

## Connecting your Spotify App to muffon
1. In muffon, go the sidebar and click on "Settings"\
![alt text](images/img_6.png)
![alt text](images/img_06.png)
2. Click on "Connections", then on "Spotify" and finally on "Connect account"

![alt text](images/img_7.png)
![alt text](images/img_07.png)

You will now see

![alt text](images/img_9.png)
![alt text](images/img_09.png)
3. Go to your spotify app in the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard) and navigate to settings.

![alt text](images/img_8.png)
![alt text](images/img_08.png)
4. Click on "View **ClientSecret**"
![alt text](images/img_10.png)
5. Copy both the ClientID and ClientSecret separately and paste them into the respective fields in muffon.
Expand Down
2 changes: 1 addition & 1 deletion electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
]
},
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}",
"compression": "store",
"compression": "ultra",
"nsis": {
"allowToChangeInstallationDirectory": true,
"deleteAppDataOnUninstall": true,
Expand Down
17 changes: 17 additions & 0 deletions electron/actions/aboutView/setBounds.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export default function () {
const [
width,
height
] = aboutWindow.getSize()

const boundsOptions = {
x: 0,
y: 0,
width,
height
}

aboutView.setBounds(
boundsOptions
)
}
51 changes: 38 additions & 13 deletions electron/actions/aboutWindow/create.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import {
BrowserWindow
BaseWindow,
WebContentsView
} from 'electron'
import {
windowIcon
} from '#/helpers/icons'
import {
baseUrl
} from '#/helpers/urls'
import setAboutViewBounds from '#/actions/aboutView/setBounds'
import changeViewBackgroundColor
from '#/actions/view/changeBackgroundColor'

function handleClose (
event
Expand All @@ -20,9 +24,11 @@ export default function () {
const aboutWindowWidth = 500
const aboutWindowHeight = 275

const options = {
const aboutWindowOptions = {
width: aboutWindowWidth,
height: aboutWindowHeight,
minWidth: aboutWindowWidth,
minHeight: aboutWindowHeight,
icon: windowIcon,
show: false,
resizable: false,
Expand All @@ -35,22 +41,41 @@ export default function () {
}

aboutWindow =
new BrowserWindow(
options
new BaseWindow(
aboutWindowOptions
)

aboutWindow.setMinimumSize(
aboutWindowWidth,
aboutWindowHeight
)
aboutWindow.removeMenu()

aboutWindow.setMenu(
null
changeViewBackgroundColor(
aboutWindow
)

aboutWindow.loadURL(
`${baseUrl}#/about`
)
const aboutViewOptions = {
webPreferences: {
contextIsolation: false,
nodeIntegration: true
}
}

aboutView =
new WebContentsView(
aboutViewOptions
)

setAboutViewBounds()

aboutWindow
.contentView
.addChildView(
aboutView
)

aboutView
.webContents
.loadURL(
`${baseUrl}#/about`
)

aboutWindow.on(
'close',
Expand Down
4 changes: 2 additions & 2 deletions electron/actions/aboutWindow/show.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import setTitle from './setTitle'
import setAboutWindowTitle from './setTitle'

export default function () {
setTitle()
setAboutWindowTitle()

aboutWindow.show()
}
2 changes: 1 addition & 1 deletion electron/actions/app/callAccountDelete.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default function () {
mainWindow
mainView
.webContents
.send(
'account-delete'
Expand Down
2 changes: 1 addition & 1 deletion electron/actions/app/callExit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default function () {
mainWindow
mainView
.webContents
.send(
'exit'
Expand Down
2 changes: 1 addition & 1 deletion electron/actions/app/callLogout.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default function () {
mainWindow
mainView
.webContents
.send(
'logout'
Expand Down
2 changes: 1 addition & 1 deletion electron/actions/app/callNavigate.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default function (
data
) {
mainWindow
mainView
.webContents
.send(
'navigate',
Expand Down
25 changes: 21 additions & 4 deletions electron/actions/app/checkForUpdates.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import {
shell,
net
} from 'electron'
import {
autoUpdater
} from 'electron-updater'
import {
isMac,
releasesUrl
} from '#/helpers/utils'
import i18n from 'i18n'

let latestRelease
Expand Down Expand Up @@ -92,10 +99,7 @@ function handleError () {
)
}

export default function checkForUpdates () {
const releasesUrl =
'https://api.github.com/repos/staniel359/muffon/releases/latest'

function checkWithoutUpdate () {
net.fetch(
releasesUrl
).then(
Expand All @@ -104,3 +108,16 @@ export default function checkForUpdates () {
handleError
)
}

function checkWithUpdate () {
autoUpdater
.checkForUpdatesAndNotify()
}

export default function checkForUpdates () {
if (isMac) {
checkWithoutUpdate()
} else {
checkWithUpdate()
}
}
20 changes: 10 additions & 10 deletions electron/actions/app/initialize.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {
app
} from 'electron'
import setProtocols from './setProtocols'
import setAppProtocols from './setProtocols'
import setupI18n from '#/plugins/i18n'
import setupDayjs from '#/plugins/dayjs'
import setFlags from './setFlags'
import setGlobalVariables from './setGlobalVariables'
import setEvents from './setEvents'
import setup from './setup'
import setAppFlags from './setFlags'
import setAppGlobalVariables from './setGlobalVariables'
import setAppEvents from './setEvents'
import setupApp from './setup'
import {
appName,
createFolderIfNotExists
Expand All @@ -30,18 +30,18 @@ export default function () {

setupDayjs()

setFlags()
setAppFlags()

setGlobalVariables()
setAppGlobalVariables()

setProtocols()
setAppProtocols()

setEvents()
setAppEvents()

app
.whenReady()
.then(
setup
setupApp
)

app.setAppUserModelId(
Expand Down
2 changes: 1 addition & 1 deletion electron/actions/app/openDeepLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function (
)?.[1]

if (deepLink) {
mainWindow
mainView
.webContents
.send(
'open-deep-link',
Expand Down
10 changes: 5 additions & 5 deletions electron/actions/app/setEvents.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import setAppEvents from '#/events/app'
import setElectronStoreEvents from '#/events/electronStore'
import setNativeThemeEvents from '#/events/nativeTheme'
import setIpcAppEvents from '#/events/ipc/app'
import setIpcTrayEvents from '#/events/ipc/tray'
import setIpcTabEvents from '#/events/ipc/tab'
import setIpcTabsEvents from '#/events/ipc/tabs'
import setIpcStoreEvents from '#/events/ipc/store'
import setIpcAudioEvents from '#/events/ipc/audio'
import setIpcAudioFileEvents from '#/events/ipc/audioFile'
import setIpcBackgroundImageEvents from '#/events/ipc/backgroundImage'
import setIpcFileEvents from '#/events/ipc/file'
import setIpcElectronStoreEvents from '#/events/ipc/electronStore'
import setIpcDiscordEvents from '#/events/ipc/discord'
import setIpcAudioFileEvents from '#/events/ipc/audioFile'

export default function () {
setAppEvents()

setElectronStoreEvents()

setNativeThemeEvents()

setIpcAppEvents()
Expand All @@ -27,7 +29,7 @@ export default function () {

setIpcStoreEvents()

setIpcAudioEvents()
setIpcAudioFileEvents()

setIpcBackgroundImageEvents()

Expand All @@ -36,6 +38,4 @@ export default function () {
setIpcElectronStoreEvents()

setIpcDiscordEvents()

setIpcAudioFileEvents()
}
6 changes: 4 additions & 2 deletions electron/actions/app/setGlobalVariables.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
export default function () {
global.mainWindow = null

global.mainView = null

global.aboutWindow = null

global.tray = null
global.aboutView = null

global.isMaximized = false
global.tray = null

global.tabsPanelHeight = 50

Expand Down
2 changes: 1 addition & 1 deletion electron/actions/app/updateTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function () {
isDarkMode
}

mainWindow
mainView
.webContents
.send(
'native-theme-updated',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import getPath from './getPath'
import getAudioFilePath from './getPath'
import {
writeFileSync
} from 'fs'
Expand All @@ -8,7 +8,7 @@ export default function (
data
) {
const filePath =
getPath(
getAudioFilePath(
fileName
)

Expand Down
Loading