Renamed from Libremsonic to Sublime Music

This commit is contained in:
Sumner Evans
2019-10-19 20:09:11 -06:00
parent c82373aaab
commit 2c2bc9380d
39 changed files with 74 additions and 74 deletions

View File

@@ -1,5 +1,5 @@
libremsonic
===========
Sublime Music
=============
A GTK3 `Revel`_/`Subsonic`_/`Airsonic`_/\*sonic client for the Linux Desktop.
@@ -14,7 +14,7 @@ Features
- Connect to multiple Subsonic-API-compliant servers.
- Play music through Chromecasts on the same LAN.
- DBus MPRIS interface integration for controlling Libremsonic via
- DBus MPRIS interface integration for controlling Sublime Music via
``playerctl``, ``i3status-rust``, KDE Connect, and other DBus MPRIS clients.
- Browse Albums, Artists, and Playlists.
- Play queue.

View File

@@ -275,6 +275,6 @@ with open(output_file, 'w+') as outfile:
'from datetime import datetime',
'from typing import List',
'from enum import Enum',
'from libremsonic.server.api_object import APIObject',
'from sublime.server.api_object import APIObject',
*map(generate_class_for_type, output_order),
]) + '\n')

View File

@@ -1,9 +1,9 @@
{
"app-id": "com.sumnerevans.libremsonic",
"app-id": "com.sumnerevans.SublimeMusic",
"runtime": "org.gnome.Platform",
"runtime-version": "3.32",
"sdk": "org.gnome.Sdk",
"command": "libremsonic",
"command": "sublime",
"finish-args": [
"--share=ipc",
"--socket=fallback-x11",
@@ -13,7 +13,7 @@
],
"modules": [
{
"name": "libremsonic",
"name": "sublime",
"buildsystem": "simple",
"build-commands": [
"pip3 install --prefix=/app ."

View File

@@ -7,6 +7,6 @@ python3 ./flatpak-builder-tools/pip/flatpak-pip-generator --requirements-file=fl
mkdir /repo
flatpak-builder --repo=/repo flatpak_build_dir com.sumnerevans.libremsonic.json
flatpak-builder --repo=/repo flatpak_build_dir com.sumnerevans.SublimeMusic.json
flatpak build-bundle /repo libremsonic.flatpak com.sumnerevans.libremsonic
flatpak build-bundle /repo sublime.flatpak com.sumnerevans.SublimeMusic

View File

@@ -3,6 +3,6 @@ addopts =
-vvv
--doctest-modules
--ignore-glob='api_object_generator'
--cov=libremsonic
--cov=sublime
--cov-report html
--cov-report term

View File

@@ -9,7 +9,7 @@ with codecs.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
# Find the version
with codecs.open(os.path.join(here, 'libremsonic/__init__.py'),
with codecs.open(os.path.join(here, 'sublime/__init__.py'),
encoding='utf-8') as f:
for line in f:
if line.startswith('__version__'):
@@ -17,9 +17,9 @@ with codecs.open(os.path.join(here, 'libremsonic/__init__.py'),
break
setup(
name='libremsonic',
name='sublime-music',
version=version,
url='https://gitlab.com/robozman/libremsonic',
url='https://gitlab.com/sumner/sublime-music',
description='A native GTK *sonic client.',
long_description=long_description,
author='Sumner Evans',
@@ -44,7 +44,7 @@ setup(
keywords='airsonic subsonic libresonic music',
packages=find_packages(exclude=['tests']),
package_data={
'libremsonic': [
'sublime': [
'ui/app_styles.css',
'ui/mpris_specs/org.mpris.MediaPlayer2.xml',
'ui/mpris_specs/org.mpris.MediaPlayer2.Player.xml',
@@ -73,7 +73,7 @@ setup(
# platform.
entry_points={
'console_scripts': [
'libremsonic=libremsonic.__main__:main',
'sublime=sublime.__main__:main',
],
},
)

View File

@@ -5,9 +5,9 @@ import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk # noqa: F401
from .app import LibremsonicApp
from .app import SublimeMusicApp
def main():
app = LibremsonicApp()
app = SublimeMusicApp()
app.run(sys.argv)

View File

@@ -22,15 +22,15 @@ from .server.api_objects import Child
from .ui.common.players import PlayerEvent, MPVPlayer, ChromecastPlayer
class LibremsonicApp(Gtk.Application):
class SublimeMusicApp(Gtk.Application):
def __init__(self, *args, **kwargs):
super().__init__(
*args,
application_id="com.sumnerevans.libremsonic",
application_id="com.sumnerevans.sublimemusic",
flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE,
**kwargs,
)
Notify.init('LibremSonic')
Notify.init('Sublime Music')
self.window = None
self.state = ApplicationState()
@@ -42,7 +42,7 @@ class LibremsonicApp(Gtk.Application):
GLib.OptionFlags.NONE,
GLib.OptionArg.FILENAME,
'Specify a configuration file. Defaults to '
'~/.config/libremsonic/config.json',
'~/.config/sublime-music/config.json',
None,
)
@@ -57,11 +57,11 @@ class LibremsonicApp(Gtk.Application):
if config_file:
config_file = config_file.get_bytestring().decode('utf-8')
else:
# Default to ~/.config/libremsonic.
# Default to ~/.config/sublime-music.
config_folder = (
environ.get('XDG_CONFIG_HOME') or environ.get('APPDATA')
or os.path.join(environ.get('HOME'), '.config'))
config_folder = os.path.join(config_folder, 'libremsonic')
config_folder = os.path.join(config_folder, 'sublime-music')
config_file = os.path.join(config_folder, 'config.json')
self.state.config_file = config_file
@@ -117,7 +117,7 @@ class LibremsonicApp(Gtk.Application):
# Windows are associated with the application when the last one is
# closed the application shuts down.
self.window = MainWindow(application=self, title="LibremSonic")
self.window = MainWindow(application=self, title="Sublime Music")
# Configure the CSS provider so that we can style elements on the
# window.
@@ -772,7 +772,7 @@ class LibremsonicApp(Gtk.Application):
)
song_notification.add_action(
'clicked',
'Open LibremSonic',
'Open Sublime Music',
on_notification_click,
)
song_notification.show()

View File

@@ -24,10 +24,10 @@ from typing import (
import requests
from libremsonic.config import AppConfiguration, ServerConfiguration
from libremsonic.server import Server
from libremsonic.server.api_object import APIObject
from libremsonic.server.api_objects import (
from .config import AppConfiguration, ServerConfiguration
from .server import Server
from .server.api_object import APIObject
from .server.api_objects import (
Playlist,
PlaylistWithSongs,
Child,
@@ -204,7 +204,7 @@ class CacheManager(metaclass=Singleton):
os.environ.get('XDG_CACHE_HOME')
or os.path.expanduser('~/.cache'))
return Path(xdg_cache_home).joinpath(
'libremsonic', *relative_paths)
'sublime-music', *relative_paths)
def return_cached_or_download(
self,

View File

@@ -73,4 +73,4 @@ class AppConfiguration:
default_cache_location = (
os.environ.get('XDG_DATA_HOME')
or os.path.expanduser('~/.local/share'))
return os.path.join(default_cache_location, 'libremsonic')
return os.path.join(default_cache_location, 'sublime-music')

View File

@@ -73,7 +73,7 @@ class DBusManager:
self.bus_number = Gio.bus_own_name_on_connection(
connection,
'org.mpris.MediaPlayer2.libremsonic',
'org.mpris.MediaPlayer2.sublime',
Gio.BusNameOwnerFlags.NONE,
dbus_name_acquired,
dbus_name_lost,
@@ -196,7 +196,7 @@ class DBusManager:
'CanQuit': True,
'CanRaise': True,
'HasTrackList': True,
'Identity': 'Libremsonic',
'Identity': 'Sublime Music',
# TODO should implement in #29
'DesktopEntry': 'foo',
'SupportedUriSchemes': [],

View File

@@ -5,7 +5,7 @@ Defines the base class for API objects.
from enum import Enum
from typing import Any, Dict
from libremsonic.from_json import from_json as _from_json
from sublime.from_json import from_json as _from_json
class APIObject:

View File

@@ -8,7 +8,7 @@ a new API version.
from datetime import datetime
from typing import List
from enum import Enum
from libremsonic.server.api_object import APIObject
from sublime.server.api_object import APIObject
class AlbumInfo(APIObject):

View File

@@ -69,7 +69,7 @@ class Server:
return dict(
u=self.username,
p=self.password,
c='LibremSonic',
c='Sublime Music',
f='json',
v='1.15.0',
)

View File

@@ -3,7 +3,7 @@ from enum import Enum
import json
from typing import List
from libremsonic.from_json import from_json
from .from_json import from_json
from .config import AppConfiguration
from .cache_manager import CacheManager
from .server.api_objects import Child
@@ -43,7 +43,7 @@ class ApplicationState:
Configuration is stored in ``config`` which is an ``AppConfiguration``
object. UI state is stored as separate properties on this class.
Configuration is stored to disk in $XDG_CONFIG_HOME/libremsonic. State is
Configuration is stored to disk in $XDG_CONFIG_HOME/sublime-music. State is
stored in $XDG_CACHE_HOME. Nothing in state should be assumed to be
permanent. State need not be saved, the ``to_json`` and ``from_json``
functions define what part of the state will be saved across application
@@ -168,7 +168,7 @@ class ApplicationState:
# away too often...
state_filename = (
os.environ.get('XDG_CACHE_HOME') or os.path.expanduser('~/.cache'))
return os.path.join(state_filename, 'libremsonic/state.yaml')
return os.path.join(state_filename, 'sublime-music/state.yaml')
@property
def volume(self):

View File

@@ -4,12 +4,12 @@ from typing import Optional, Union
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject, GLib
from libremsonic.state_manager import ApplicationState
from libremsonic.cache_manager import CacheManager
from libremsonic.ui import util
from libremsonic.ui.common import AlbumWithSongs, IconButton, CoverArtGrid
from sublime.state_manager import ApplicationState
from sublime.cache_manager import CacheManager
from sublime.ui import util
from sublime.ui.common import AlbumWithSongs, IconButton, CoverArtGrid
from libremsonic.server.api_objects import Child, AlbumWithSongsID3
from sublime.server.api_objects import Child, AlbumWithSongsID3
Album = Union[Child, AlbumWithSongsID3]

View File

@@ -5,12 +5,12 @@ import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject, Pango, GLib, Gio
from libremsonic.state_manager import ApplicationState
from libremsonic.cache_manager import CacheManager
from libremsonic.ui import util
from libremsonic.ui.common import AlbumWithSongs, IconButton, SpinnerImage
from sublime.state_manager import ApplicationState
from sublime.cache_manager import CacheManager
from sublime.ui import util
from sublime.ui.common import AlbumWithSongs, IconButton, SpinnerImage
from libremsonic.server.api_objects import (
from sublime.server.api_objects import (
AlbumID3,
ArtistInfo2,
ArtistWithAlbumsID3,

View File

@@ -6,13 +6,13 @@ import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject, Pango, GLib
from libremsonic.state_manager import ApplicationState
from libremsonic.cache_manager import CacheManager
from libremsonic.ui import util
from sublime.state_manager import ApplicationState
from sublime.cache_manager import CacheManager
from sublime.ui import util
from .icon_button import IconButton
from .spinner_image import SpinnerImage
from libremsonic.server.api_objects import (
from sublime.server.api_objects import (
AlbumWithSongsID3,
Child,
Directory,

View File

@@ -5,7 +5,7 @@ import gi
gi.require_version('Gtk', '3.0')
from gi.repository import GLib, Gtk, GObject, Gio, Pango
from libremsonic.state_manager import ApplicationState
from sublime.state_manager import ApplicationState
from .spinner_image import SpinnerImage

View File

@@ -12,9 +12,9 @@ import pychromecast
import mpv
import bottle
from libremsonic.config import AppConfiguration
from libremsonic.cache_manager import CacheManager
from libremsonic.server.api_objects import Child
from sublime.config import AppConfiguration
from sublime.cache_manager import CacheManager
from sublime.server.api_objects import Child
class PlayerEvent:

View File

@@ -4,9 +4,9 @@ import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject
from libremsonic.server import Server
from libremsonic.config import ServerConfiguration
from libremsonic.ui.common import EditFormDialog, IconButton
from sublime.server import Server
from sublime.config import ServerConfiguration
from sublime.ui.common import EditFormDialog, IconButton
class EditServerDialog(EditFormDialog):

View File

@@ -3,11 +3,11 @@ gi.require_version('Gtk', '3.0')
from gi.repository import Gio, Gtk, GObject
from . import albums, artists, playlists, player_controls
from libremsonic.state_manager import ApplicationState
from sublime.state_manager import ApplicationState
class MainWindow(Gtk.ApplicationWindow):
"""Defines the main window for LibremSonic."""
"""Defines the main window for Sublime Music."""
__gsignals__ = {
'song-clicked': (
GObject.SignalFlags.RUN_FIRST,
@@ -85,7 +85,7 @@ class MainWindow(Gtk.ApplicationWindow):
"""
header = Gtk.HeaderBar()
header.set_show_close_button(True)
header.props.title = 'LibremSonic'
header.props.title = 'Sublime Music'
# Search
search = Gtk.SearchEntry()

View File

@@ -4,11 +4,11 @@ import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Pango, GObject, Gio, GLib
from libremsonic.cache_manager import CacheManager
from libremsonic.state_manager import ApplicationState, RepeatType
from libremsonic.ui import util
from libremsonic.ui.common import IconButton, SpinnerImage
from libremsonic.ui.common.players import ChromecastPlayer
from sublime.cache_manager import CacheManager
from sublime.state_manager import ApplicationState, RepeatType
from sublime.ui import util
from sublime.ui.common import IconButton, SpinnerImage
from sublime.ui.common.players import ChromecastPlayer
class PlayerControls(Gtk.ActionBar):

View File

@@ -8,11 +8,11 @@ import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gio, Gtk, Pango, GObject, GLib
from libremsonic.server.api_objects import PlaylistWithSongs
from libremsonic.state_manager import ApplicationState
from libremsonic.cache_manager import CacheManager
from libremsonic.ui import util
from libremsonic.ui.common import EditFormDialog, IconButton, SpinnerImage
from sublime.server.api_objects import PlaylistWithSongs
from sublime.state_manager import ApplicationState
from sublime.cache_manager import CacheManager
from sublime.ui import util
from sublime.ui.common import EditFormDialog, IconButton, SpinnerImage
class EditPlaylistDialog(EditFormDialog):

View File

@@ -10,7 +10,7 @@ import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GLib, Gdk, GObject
from libremsonic.cache_manager import CacheManager, SongCacheStatus
from sublime.cache_manager import CacheManager, SongCacheStatus
def format_song_duration(duration_secs) -> str: