Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jaedb committed May 14, 2022
2 parents d15fcc7 + 5942698 commit 1158b46
Show file tree
Hide file tree
Showing 36 changed files with 2,151 additions and 1,347 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/*

# Install libspotify-dev from apt.mopidy.com
RUN wget -q -O - https://apt.mopidy.com/mopidy.gpg \
| APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn apt-key add - \
RUN mkdir -p /usr/local/share/keyrings \
&& wget -q -O /usr/local/share/keyrings/mopidy-archive-keyring.gpg https://apt.mopidy.com/mopidy.gpg \
&& wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/buster.list \
&& apt-get update \
&& apt-get install -y libspotify-dev mopidy-spotify \
Expand Down
2 changes: 1 addition & 1 deletion IRIS_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.62.0
3.63.0
18 changes: 13 additions & 5 deletions mopidy_iris/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ class IrisCore(pykka.ThreadingActor):
"seed_tracks": [],
"results": [],
}
data = {
"commands": [],
"pinned": [],
}
data = {}
ioloop = None

@classmethod
Expand All @@ -60,9 +57,9 @@ def setup(self, config, core):
def start(self):
logger.info("Starting Iris " + Extension.version)

# Load our commands and pinned items from file
self.data["commands"] = self.load_from_file("commands")
self.data["pinned"] = self.load_from_file("pinned")
self.data["shared_config"] = self.load_from_file("shared_config")

##
# Mopidy is shutting down
Expand Down Expand Up @@ -409,6 +406,7 @@ def get_config(self, *args, **kwargs):
"genius_authorization_url": self.config["iris"][
"genius_authorization_url"
],
"shared_config": self.data["shared_config"],
}
}

Expand Down Expand Up @@ -879,6 +877,16 @@ def get_pinned(self, *args, **kwargs):
def set_pinned(self, *args, **kwargs):
return self.set_data("pinned", *args, **kwargs)

##
# Portable configuration template for other users to import
##

def get_shared_config(self, *args, **kwargs):
return self.get_data("shared_config", *args, **kwargs)

def set_shared_config(self, *args, **kwargs):
return self.set_data("shared_config", *args, **kwargs)

##
# Commands
##
Expand Down
1,641 changes: 841 additions & 800 deletions mopidy_iris/static/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mopidy_iris/static/app.js.map

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions mopidy_iris/static/app.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mopidy_iris/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@

// Release details
// These are automatically injected to built HTML
var build = "1646809993";
var build = "1652000473";
var version = "3.62.0";

// Construct the script tag
Expand Down
20 changes: 7 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/js/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import Search from './views/Search';
import Settings from './views/Settings';
import Discover from './views/Discover/Discover';
import Library from './views/Library/Library';
import ModalStateListener from './components/ModalStateListener';
import Modals from './views/Modals/Modals';

import { scrollTo, isTouchDevice } from './util/helpers';
Expand Down Expand Up @@ -251,6 +252,7 @@ const App = () => {
options={{ enableMouseEvents: true }}
>
<div className="body">
<ModalStateListener />
<Switch>
<Route
path="/modal"
Expand Down
16 changes: 16 additions & 0 deletions src/js/components/ModalStateListener.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { useSelector } from 'react-redux';
import { useHistory, useLocation } from 'react-router-dom';

const ModalStateListener = () => {
const { name } = useSelector((state) => state.ui.modal || {});
const history = useHistory();
const location = useLocation();

if (name && location.pathname.indexOf(`modal/${name}`) < 0) {
history.push(`modal/${name}`);
}

return null;
}

export default ModalStateListener;
52 changes: 1 addition & 51 deletions src/js/components/Notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,56 +45,6 @@ const Notification = ({
</div>
);

case 'share-configuration-received':
return (
<div className="notification__wrapper">
<div className="notification notification--info" data-duration={duration}>
<Icon
name="close"
className="notification__close-button"
onClick={() => dispatch(removeNotification(key, true))}
/>
<h4 className="notification__title">
<I18n path="modal.share_configuration.import.title" />
</h4>
<div className="notification__content">
<p>
<I18n path="modal.share_configuration.import.subtitle" />
</p>
<ul>
{configuration.ui && (
<li><I18n path="modal.share_configuration.interface" /></li>
)}
{configuration.spotify && (
<li><I18n path="services.spotify.title" /></li>
)}
{configuration.lastfm && (
<li><I18n path="services.lastfm.title" /></li>
)}
{configuration.genius && (
<li><I18n path="services.genius.title" /></li>
)}
{configuration.snapcast && (
<li><I18n path="services.snapcast.title" /></li>
)}
</ul>
<p>
<I18n path="modal.share_configuration.import.do_you_want_to_import" />
</p>
</div>
<div className="notification__actions">
<Button
className="notification__actions__item"
onClick={() => importConfiguration(key, configuration)}
tracking={{ category: 'ShareConfiguration', action: 'Import' }}
>
<I18n path="modal.share_configuration.import.import_now" />
</Button>
</div>
</div>
</div>
);

default:
return (
<div className="notification__wrapper" key={key}>
Expand Down Expand Up @@ -185,7 +135,7 @@ const NotificationItems = () => {

dispatch(uiActions.removeNotification(notification_key, true));
dispatch(uiActions.createNotification({
content: i18n('modal.share_configuration.import.successful'),
content: i18n('modal.shared_config.imported'),
}));
}

Expand Down
6 changes: 6 additions & 0 deletions src/js/locale/dictionaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import _ja from './ja.yaml';
import _pl from './pl.yaml';
import _it from './it.yaml';
import _es from './es.yaml';
import _ru from './ru.yaml';

// Merge languages with English. This provides English fallbacks to untranslated
// fields without breaking the UI (with blanks)
Expand All @@ -27,6 +28,8 @@ const it = {};
merge(it, en, _it);
const es = {};
merge(es, en, _es);
const ru = {};
merge(ru, en, _ru);

const available = [
{ key: 'en', name: en.name },
Expand All @@ -37,6 +40,7 @@ const available = [
{ key: 'ja', name: ja.name },
{ key: 'nl', name: nl.name },
{ key: 'pl', name: pl.name },
{ key: 'ru', name: ru.name },
{ key: 'sv', name: sv.name },
];

Expand All @@ -50,6 +54,7 @@ export default {
ja,
pl,
it,
ru,
available,
};

Expand All @@ -63,5 +68,6 @@ export {
ja,
pl,
it,
ru,
available,
};
56 changes: 41 additions & 15 deletions src/js/locale/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,10 @@ settings:
upgrade_available: 'Upgrade available (%{version})'
upgrade: 'Upgrade to %{version}'
up_to_date: Up to date
share_configuration: Share configuration
shared_configuration:
label: Share configuration
share: Export/share
import: Import from server
restart: Restart server
reset: Reset settings
about:
Expand Down Expand Up @@ -569,23 +572,46 @@ modal:
title: Now playing
title_window: '%{name} by %{artist} (now playing)'
lyrics: Lyrics
share_configuration:
title: Share configuration
subtitle: Push your authorizations and interface settings to another, connected user
import_configuration:
title: Import configuration
configurations: Configurations to import
import_now: Import now
shared_config:
no_peers: No peer connections
recipients: Recipients
configurations: Configurations
authorization: '%{service} authorization'
logged_in_as: 'Logged in as %{name}'
snapcast_description: Server connection details
interface: Interface settings
interface_description: Theme, sorting, filters, etc
import:
title: Configuration shared
subtitle: 'Another user has shared their configuration with you. This includes:'
do_you_want_to_import: Do you want to import this?
import_now: Import now
successful: Import successful
import_now: Import now
imported: Import successful
share: Share now
shared: Share successful
push:
title: Share configuration
subtitle: Push your authorizations and interface settings to another, connected user
pushed:
title: Configuration received
subtitle: Another user has shared their configuration with you
server:
title: Import configuration
subtitle: Import third-party authorizations and other settings
label: Server
description: Save to server for any user to import
config:
label: Configurations
ui:
label: User interface
description: Theme, sorting, filters, etc
spotify:
label: Spotify authorisation
description: 'Logged in as %{name}'
lastfm:
label: LastFM authorisation
description: 'Logged in as %{name}'
genius:
label: Genius authorisation
description: 'Logged in as %{name}'
snapcast:
label: Snapcast
description: Server connection details
reset:
title: Reset Iris
subtitle: Clear your local configuration, storage information or cache
Expand Down
Loading

0 comments on commit 1158b46

Please sign in to comment.