Skip to content

Commit

Permalink
Merge branch 'master' of github.com:nukeop/nuclear into feature/ts-in…
Browse files Browse the repository at this point in the history
…-app
  • Loading branch information
nukeop committed Jul 21, 2020
2 parents 3f57740 + 09bf9fa commit 3eacfad
Show file tree
Hide file tree
Showing 83 changed files with 1,430 additions and 810 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,7 @@ jsconfig.json

#lerna
lerna-debug.log

#flatpak
.flatpak-builder
build-dir
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package-lock=false
package-lock=False
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
- GITHASH=${TRAVIS_COMMIT::6}

before_install:
- if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get install libdbus-1-dev -y; fi
- if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get install libdbus-1-dev rpm -y; fi

script:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then npm test && npm run build:linux; fi
Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ Here's a list of packages for various managers, most of which are maintained by
| AUR (Arch) | https://aur.archlinux.org/packages/nuclear-player-bin/ | [mikelpint](https://github.com/mikelpint) |
| Choco (Win) | https://chocolatey.org/packages/nuclear/ | [JourneyOver](https://github.com/JourneyOver) |
| Homebrew (Mac) | https://formulae.brew.sh/cask/nuclear | Homebrew |
| Snap | https://snapcraft.io/nuclear | [nukeop](https://github.com/nukeop) |
| Snap | https://snapcraft.io/nuclear | [nukeop](https://github.com/nukeop) |
|Flatpak |(to be approved) | [advaithm](https://github.com/advaithm) |

big thanks to [ayyeve](https://github.com/ayyEve) for letting me (advaithm) use her server as a compile machine.
## Community translations
Nuclear has already been translated to several languages, and we're always looking for contributors who would like to add more. Below is a list of currently available languages, along with contributors who helped to translate Nuclear to that language.

Expand Down Expand Up @@ -112,6 +114,21 @@ You will need docker and docker-compose. You need to allow the root user to conn
$ xhost SI:localuser:root
$ sudo docker-compose up dev
```
As of now you can also build a flatpak version. You will need to install gobject-introspection, and flatpak-builder. After this you will need to install the runtimes and depedencies required by flatapk-builder for the compile process. You will need the 19.08 version of these flatpaks.
```shell
$ flatpak install flathub org.freedesktop.Platform
$ flatpak install flathub org.freedesktop.Sdk
$ flatpak install flathub io.atom.electron.BaseApp
```
Next, to build the project (use the `--verbose` flag to get more output):
```shell
$ flatpak-builder build-dir org.js.nuclear.Nuclear.json
```
To run the built app:
```shell
$ flatpak-builder --run build-dir org.js.nuclear.Nuclear.json run.sh
```
You can turn the app to a local repo. currently the file builds the latest release.

## Screenshots
This will be updated as the program evolves.
Expand Down
3 changes: 3 additions & 0 deletions flatpak/flathub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"only-arches":["x86_64"]
}
9 changes: 9 additions & 0 deletions flatpak/org.js.nuclear.Nuclear.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Name=Nuclear
Comment=Streaming music player that finds music sources automatically.
Comment[es]=Reproductor que retransmite música desde fuentes encontradas automáticamente.
Exec="/app/bin/run.sh"
Terminal=false
Type=Application
Icon=org.js.nuclear.Nuclear
Categories=Audio;AudioVideo;Network;Player;Music;
71 changes: 71 additions & 0 deletions flatpak/org.js.nuclear.Nuclear.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"app-id": "org.js.nuclear.Nuclear",
"runtime": "org.freedesktop.Platform",
"runtime-version": "19.08",
"branch": "19.08",
"sdk": "org.freedesktop.Sdk",
"base": "io.atom.electron.BaseApp",
"separate-locales": "false",
"command": "run.sh",
"finish-args": [
"--share=network",
"--share=ipc",
"--socket=x11",
"--filesystem=host",
"--socket=pulseaudio"
],
"build-options" : {
"env": {
"NPM_CONFIG_LOGLEVEL": "info"
}
},
"modules": [
{
"name": "nuclear",
"buildsystem": "simple",
"sources": [
{
"type": "archive",
"url": "https://github.com/nukeop/nuclear/releases/download/v0.6.3/nuclear-fca030.tar.gz",
"sha256": "5b90a1064736c158f62ea74c5814dffdd25f8b6a3877dfeed065377e744cdd2e"
},
{
"type":"file",
"url":"https://raw.githubusercontent.com/advaithm/nuclear/master/flatpak/org.js.nuclear.Nuclear.metainfo.xml",
"sha256":"17f2d8221f3cfec579457c05a4a56b85dcff2dd44bc86d5a2bca85e088af7c39",
"dest-filename":"org.js.nuclear.Nuclear.metainfo.xml"
},
{
"type":"file",
"url":"https://raw.githubusercontent.com/advaithm/nuclear/master/flatpak/org.js.nuclear.Nuclear.desktop",
"sha256":"61256cb50cbfa54d93b9c344f4795f42f7dc73cd195be17915403d0ac281ce88",
"dest-filename":"org.js.nuclear.Nuclear.desktop"
},
{
"type":"file",
"url":"https://github.com/nukeop/nuclear/raw/master/build/512.png",
"sha1":"f7568bc736304246d054faa7cf528c3e8bc0a6d5",
"dest-filename":"org.js.nuclear.Nuclear.png"
},
{
"type": "script",
"dest-filename": "run.sh",
"commands": [ "/app/main/nuclear" ]
}

],
"build-commands": [
"mkdir -p /app/main /app/bin",
"cp -ra * /app/main/",
"mkdir -p /app/share/metainfo/",
"mkdir -p /app/share/icons/hicolor/512x512/apps/",
"mkdir -p /app/share/applications/",
"cp -r org.js.nuclear.Nuclear.png /app/share/icons/hicolor/512x512/apps/",
"ls /app/share/icons/hicolor/512x512/apps/",
"cp -r org.js.nuclear.Nuclear.metainfo.xml /app/share/metainfo/",
"cp -r org.js.nuclear.Nuclear.desktop /app/share/applications/",
"install run.sh /app/bin/"
]
}
]
}
75 changes: 75 additions & 0 deletions flatpak/org.js.nuclear.Nuclear.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>org.js.nuclear.Nuclear</id>
<metadata_license>FSFAP</metadata_license>
<project_license>GPL-3.0+</project_license>
<name>nuclear music player</name>
<summary>A electron based music player</summary>
<content_rating type="oars-1.1" />
<description>
<p>nuclear is a free music streaming program that pulls content from free sources all over the internet.</p>

<p>If you know mps-youtube, this is a similar music player but with a GUI.
It's also focusing more on audio. Imagine Spotify which you don't have to pay for and with a bigger library.</p>

<p>Features</p>
<ul>
<li>- Searching for and playing music from YouTube (including integration with playlists), Jamendo, and SoundCloud</li>
<li>- Searching for albums (powered by Last.fm and Discogs), album view, automatic song lookup based on artist and track name (in progress, can be dodgy sometimes)</li>
<li>- Song queue, which can be exported as a playlist</li>
<li>- Loading saved playlists (stored in json files)</li>
<li>- Scrobbling to last.fm (along with updating the 'now playing' status)</li>
<li>- Newest releases with reviews - tracks and albums</li>
<li>- Browsing by genre</li>
<li>- Radio mode (automatically queue similar tracks)</li>
<li>- Unlimited downloads (powered by youtube)</li>
<li>- Realtime lyrics</li>
<li>- Browsing by popularity</li>
<li>- List of favorite tracks</li>
<li>- Listening from local library</li>
</ul>
</description>
<launchable type="desktop-id">org.js.nuclear.Nuclear.desktop</launchable>
<screenshots>
<screenshot type="default">
<caption>Album Search</caption>
<image>https://i.imgur.com/idFVnAF.png</image>
</screenshot>
<screenshot>
<caption>Album Display</caption>
<image>https://i.imgur.com/Kvzo3q7.png</image>
</screenshot>
<screenshot>
<caption>Dashboard Best New Music</caption>
<image>https://i.imgur.com/bMDrR4M.png</image>
</screenshot>
<screenshot>
<caption>Dashboard Genres</caption>
<image>https://i.imgur.com/g0aCmKx.png)</image>
</screenshot>
<screenshot>
<caption>Playlist View</caption>
<image>https://i.imgur.com/2VMXHDC.png</image>
</screenshot>
<screenshot>
<caption>Lyrics View</caption>
<image>https://i.imgur.com/7e3DJKJ.png</image>
</screenshot>
<screenshot>
<caption>Equalizer View</caption>
<image>https://i.imgur.com/WreRL0w.png</image>
</screenshot>
</screenshots>
<url type="homepage">https://nuclear.js.org</url>
<project_group>Nuclear</project_group>
<provides>
<binary>Nuclear</binary>
</provides>
<releases>
<release version="0.6.3" date="2020-02-04">
<description>
<p>This release fixes the recent issues where queue items would keep loading indefinitely.</p>
</description>
</release>
</releases>
</component>
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"target": [
"AppImage",
"deb",
"rpm",
"tar.gz",
"snap"
],
Expand Down
117 changes: 2 additions & 115 deletions packages/app/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import classnames from 'classnames';
import _ from 'lodash';
import Sound from 'react-hifi';
import { withTranslation } from 'react-i18next';
import { Cover, formatDuration } from '@nuclear/ui';
import { PluginConfig } from '@nuclear/core';

import * as SearchActions from './actions/search';
Expand All @@ -28,12 +27,10 @@ import compact from './compact.scss';

import logoImg from '../resources/media/logo_full_light.png';
import logoIcon from '../resources/media/512x512.png';
import artPlaceholder from '../resources/media/art_placeholder.png';

import settingsConst from './constants/settings';

import PlaylistsSubMenu from './components/PlaylistsSubMenu';
import Footer from './components/Footer';
import Navbar from './components/Navbar';
import VerticalPanel from './components/VerticalPanel';
import Spacer from './components/Spacer';
Expand All @@ -42,6 +39,7 @@ import HelpModalContainer from './containers/HelpModalContainer';
import MainContentContainer from './containers/MainContentContainer';
import PlayQueueContainer from './containers/PlayQueueContainer';
import SearchBoxContainer from './containers/SearchBoxContainer';
import PlayerBarContainer from './containers/PlayerBarContainer';

import IpcContainer from './containers/IpcContainer';
import SoundContainer from './containers/SoundContainer';
Expand All @@ -50,15 +48,10 @@ import ShortcutsContainer from './containers/ShortcutsContainer';
import ErrorBoundary from './containers/ErrorBoundary';

import NavButtons from './components/NavButtons';
import PlayerControls from './components/PlayerControls';
import Seekbar from './components/Seekbar';
import SidebarMenu from './components/SidebarMenu';
import SidebarMenuItem from './components/SidebarMenu/SidebarMenuItem';
import SidebarMenuCategoryHeader from './components/SidebarMenu/SidebarMenuCategoryHeader';
import TrackDuration from './components/TrackDuration';
import TrackInfo from './components/TrackInfo';
import WindowControls from './components/WindowControls';
import VolumeControls from './components/VolumeControls';

@withTranslation('app')
class App extends React.PureComponent {
Expand Down Expand Up @@ -248,118 +241,12 @@ class App extends React.PureComponent {
);
}

renderFooter () {
return (
<Footer className={styles.footer}>
<Seekbar
fill={this.props.player.playbackProgress + '%'}
seek={this.props.actions.updateSeek}
queue={this.props.queue}
>
{
this.props.settings.trackDuration &&
!_.isNil(this.props.queue.queueItems[this.props.queue.currentSong]) &&
this.renderTrackDuration()
}
</Seekbar>
<div className={styles.footer_horizontal}>
<div className={styles.track_info_wrapper}>
{this.renderCover()}
{this.renderTrackInfo()}
</div>
{this.renderPlayerControls()}
{this.renderVolumeControl()}
</div>
</Footer>
);
}

renderTrackDuration() {
const currentTrackStream = _.head(
_.get(
this.props.queue.queueItems[this.props.queue.currentSong],
'streams'
)
);

const currentTrackDuration = _.get(
currentTrackStream,
'duration'
);

const timeToEnd = currentTrackDuration - this.props.player.seek;

return (
<TrackDuration
timePlayed={formatDuration(this.props.player.seek)}
timeToEnd={
(!_.isNil(currentTrackDuration) && ('-' + formatDuration(timeToEnd)))
|| '0'
}
/>
);
}

renderCover () {
return (
<Cover
cover={
this.props.queue.queueItems[this.props.queue.currentSong]
? this.props.queue.queueItems[this.props.queue.currentSong]
.thumbnail
: artPlaceholder
}
/>
);
}

getCurrentSongParameter (parameter) {
return this.props.queue.queueItems[this.props.queue.currentSong]
? this.props.queue.queueItems[this.props.queue.currentSong][parameter]
: null;
}

renderTrackInfo () {
return (
<TrackInfo
track={this.getCurrentSongParameter('name')}
artist={this.getCurrentSongParameter('artist')}
artistInfoSearchByName={this.props.actions.artistInfoSearchByName}
history={this.props.history}
/>
);
}

renderPlayerControls () {
const { player, queue } = this.props;
const couldPlay = queue.queueItems.length > 0;
const couldForward = couldPlay && queue.currentSong + 1 < queue.queueItems.length;
const couldBack = couldPlay && queue.currentSong > 0;

return (
<PlayerControls
togglePlay={couldPlay ? this.togglePlayback.bind(this) : undefined}
playing={player.playbackStatus === Sound.status.PLAYING}
loading={player.playbackStreamLoading}
forward={couldForward ? this.nextSong.bind(this) : undefined}
back={couldBack ? this.props.actions.previousSong : undefined}
/>
);
}

renderVolumeControl () {
return (
<VolumeControls
fill={this.props.player.volume}
updateVolume={this.props.actions.updateVolume}
muted={this.props.player.muted}
toggleMute={this.props.actions.toggleMute}
toggleOption={this.props.actions.toggleOption}
settings={this.props.settings}
/>
);
}

render () {
return (
<React.Fragment>
Expand All @@ -373,7 +260,7 @@ class App extends React.PureComponent {
</VerticalPanel>
{this.renderRightPanel()}
</div>
{this.renderFooter()}
<PlayerBarContainer />
<SoundContainer />
<IpcContainer />
</div>
Expand Down
Loading

0 comments on commit 3eacfad

Please sign in to comment.