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. A GTK3 `Revel`_/`Subsonic`_/`Airsonic`_/\*sonic client for the Linux Desktop.
@@ -14,7 +14,7 @@ Features
- Connect to multiple Subsonic-API-compliant servers. - Connect to multiple Subsonic-API-compliant servers.
- Play music through Chromecasts on the same LAN. - 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. ``playerctl``, ``i3status-rust``, KDE Connect, and other DBus MPRIS clients.
- Browse Albums, Artists, and Playlists. - Browse Albums, Artists, and Playlists.
- Play queue. - Play queue.

View File

@@ -275,6 +275,6 @@ with open(output_file, 'w+') as outfile:
'from datetime import datetime', 'from datetime import datetime',
'from typing import List', 'from typing import List',
'from enum import Enum', '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), *map(generate_class_for_type, output_order),
]) + '\n') ]) + '\n')

View File

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

View File

@@ -7,6 +7,6 @@ python3 ./flatpak-builder-tools/pip/flatpak-pip-generator --requirements-file=fl
mkdir /repo 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 -vvv
--doctest-modules --doctest-modules
--ignore-glob='api_object_generator' --ignore-glob='api_object_generator'
--cov=libremsonic --cov=sublime
--cov-report html --cov-report html
--cov-report term --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() long_description = f.read()
# Find the version # 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: encoding='utf-8') as f:
for line in f: for line in f:
if line.startswith('__version__'): if line.startswith('__version__'):
@@ -17,9 +17,9 @@ with codecs.open(os.path.join(here, 'libremsonic/__init__.py'),
break break
setup( setup(
name='libremsonic', name='sublime-music',
version=version, version=version,
url='https://gitlab.com/robozman/libremsonic', url='https://gitlab.com/sumner/sublime-music',
description='A native GTK *sonic client.', description='A native GTK *sonic client.',
long_description=long_description, long_description=long_description,
author='Sumner Evans', author='Sumner Evans',
@@ -44,7 +44,7 @@ setup(
keywords='airsonic subsonic libresonic music', keywords='airsonic subsonic libresonic music',
packages=find_packages(exclude=['tests']), packages=find_packages(exclude=['tests']),
package_data={ package_data={
'libremsonic': [ 'sublime': [
'ui/app_styles.css', 'ui/app_styles.css',
'ui/mpris_specs/org.mpris.MediaPlayer2.xml', 'ui/mpris_specs/org.mpris.MediaPlayer2.xml',
'ui/mpris_specs/org.mpris.MediaPlayer2.Player.xml', 'ui/mpris_specs/org.mpris.MediaPlayer2.Player.xml',
@@ -73,7 +73,7 @@ setup(
# platform. # platform.
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [
'libremsonic=libremsonic.__main__:main', 'sublime=sublime.__main__:main',
], ],
}, },
) )

View File

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

View File

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

View File

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

View File

@@ -73,4 +73,4 @@ class AppConfiguration:
default_cache_location = ( default_cache_location = (
os.environ.get('XDG_DATA_HOME') os.environ.get('XDG_DATA_HOME')
or os.path.expanduser('~/.local/share')) 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( self.bus_number = Gio.bus_own_name_on_connection(
connection, connection,
'org.mpris.MediaPlayer2.libremsonic', 'org.mpris.MediaPlayer2.sublime',
Gio.BusNameOwnerFlags.NONE, Gio.BusNameOwnerFlags.NONE,
dbus_name_acquired, dbus_name_acquired,
dbus_name_lost, dbus_name_lost,
@@ -196,7 +196,7 @@ class DBusManager:
'CanQuit': True, 'CanQuit': True,
'CanRaise': True, 'CanRaise': True,
'HasTrackList': True, 'HasTrackList': True,
'Identity': 'Libremsonic', 'Identity': 'Sublime Music',
# TODO should implement in #29 # TODO should implement in #29
'DesktopEntry': 'foo', 'DesktopEntry': 'foo',
'SupportedUriSchemes': [], 'SupportedUriSchemes': [],

View File

@@ -5,7 +5,7 @@ Defines the base class for API objects.
from enum import Enum from enum import Enum
from typing import Any, Dict 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: class APIObject:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -5,7 +5,7 @@ import gi
gi.require_version('Gtk', '3.0') gi.require_version('Gtk', '3.0')
from gi.repository import GLib, Gtk, GObject, Gio, Pango 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 from .spinner_image import SpinnerImage

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -10,7 +10,7 @@ import gi
gi.require_version('Gtk', '3.0') gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GLib, Gdk, GObject 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: def format_song_duration(duration_secs) -> str: