Merge branch 'develop' into albums-cache
This commit is contained in:
@@ -47,15 +47,15 @@ build:
|
|||||||
- dist/*
|
- dist/*
|
||||||
|
|
||||||
build_flatpak:
|
build_flatpak:
|
||||||
image: registry.gitlab.com/robozman/libremsonic/libremsonic/build:latest
|
image: registry.gitlab.com/sumner/sublime-music/sublime-music/build:latest
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- cd flatpak
|
- cd flatpak
|
||||||
- ./flatpak_build.sh
|
- ./flatpak_build.sh
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "libremsonic-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA"
|
name: "sublime-music-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA"
|
||||||
paths:
|
paths:
|
||||||
- flatpak/libremsonic.flatpak
|
- flatpak/sublime.flatpak
|
||||||
|
|
||||||
deploy_pypi:
|
deploy_pypi:
|
||||||
image: python:3.6-alpine
|
image: python:3.6-alpine
|
||||||
|
22
README.rst
22
README.rst
@@ -24,7 +24,20 @@ Features
|
|||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
|
||||||
TODO
|
**Via the AUR**:
|
||||||
|
|
||||||
|
Install the ``sublime-music`` package. Example using ``yay``::
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
|
**Via Flatpak**:
|
||||||
|
|
||||||
|
TODO: make a link to the flathub repo so that you can just click on it and go to
|
||||||
|
the software center for the app.
|
||||||
|
|
||||||
|
**Via PyPi**::
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
Development Setup
|
Development Setup
|
||||||
-----------------
|
-----------------
|
||||||
@@ -33,6 +46,13 @@ Requirements:
|
|||||||
|
|
||||||
- Python 3.7
|
- Python 3.7
|
||||||
- GTK3
|
- GTK3
|
||||||
|
- GLib
|
||||||
|
|
||||||
|
Install the Sublime Music app locally (commands may differ from what is
|
||||||
|
described below, this is merely an outline)::
|
||||||
|
|
||||||
|
pip install -e . --user
|
||||||
|
pip install -r dev-requirements.txt
|
||||||
|
|
||||||
Building the flatpak
|
Building the flatpak
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
|
15
flatpak/Dockerfile
Normal file
15
flatpak/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
FROM fedora:30
|
||||||
|
|
||||||
|
MAINTAINER robozman "https://gitlab.com/robozman"
|
||||||
|
|
||||||
|
VOLUME [ "/sys/fs/cgroup", "/tmp", "/run" ]
|
||||||
|
|
||||||
|
|
||||||
|
RUN dnf -y update && \
|
||||||
|
dnf install -y flatpak flatpak-builder ostree fuse wget curl elfutils dconf git bzip2 bzr python3 python3-pip && \
|
||||||
|
dnf clean all
|
||||||
|
|
||||||
|
RUN flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||||
|
|
||||||
|
RUN flatpak install -y org.gnome.Platform//3.32 && \
|
||||||
|
flatpak install -y org.gnome.Sdk//3.32
|
@@ -130,6 +130,7 @@ class CacheManager(metaclass=Singleton):
|
|||||||
hostname=server_config.server_address,
|
hostname=server_config.server_address,
|
||||||
username=server_config.username,
|
username=server_config.username,
|
||||||
password=server_config.password,
|
password=server_config.password,
|
||||||
|
disable_cert_verify=server_config.disable_cert_verify,
|
||||||
)
|
)
|
||||||
self.download_limiter_semaphore = threading.Semaphore(
|
self.download_limiter_semaphore = threading.Semaphore(
|
||||||
self.app_config.concurrent_download_limit)
|
self.app_config.concurrent_download_limit)
|
||||||
|
@@ -12,6 +12,7 @@ class ServerConfiguration:
|
|||||||
password: str
|
password: str
|
||||||
browse_by_tags: bool
|
browse_by_tags: bool
|
||||||
sync_enabled: bool
|
sync_enabled: bool
|
||||||
|
disable_cert_verify: bool
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@@ -23,6 +24,7 @@ class ServerConfiguration:
|
|||||||
password='',
|
password='',
|
||||||
browse_by_tags=False,
|
browse_by_tags=False,
|
||||||
sync_enabled=True,
|
sync_enabled=True,
|
||||||
|
disable_cert_verify=False,
|
||||||
):
|
):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.server_address = server_address
|
self.server_address = server_address
|
||||||
@@ -32,6 +34,7 @@ class ServerConfiguration:
|
|||||||
self.password = password
|
self.password = password
|
||||||
self.browse_by_tags = browse_by_tags
|
self.browse_by_tags = browse_by_tags
|
||||||
self.sync_enabled = sync_enabled
|
self.sync_enabled = sync_enabled
|
||||||
|
self.disable_cert_verify = disable_cert_verify
|
||||||
|
|
||||||
|
|
||||||
class AppConfiguration:
|
class AppConfiguration:
|
||||||
|
@@ -58,11 +58,19 @@ class Server:
|
|||||||
* The ``server`` module is stateless. The only thing that it does is allow
|
* The ``server`` module is stateless. The only thing that it does is allow
|
||||||
the module's user to query the *sonic server via the API.
|
the module's user to query the *sonic server via the API.
|
||||||
"""
|
"""
|
||||||
def __init__(self, name: str, hostname: str, username: str, password: str):
|
def __init__(
|
||||||
|
self,
|
||||||
|
name: str,
|
||||||
|
hostname: str,
|
||||||
|
username: str,
|
||||||
|
password: str,
|
||||||
|
disable_cert_verify: bool,
|
||||||
|
):
|
||||||
self.name: str = name
|
self.name: str = name
|
||||||
self.hostname: str = hostname
|
self.hostname: str = hostname
|
||||||
self.username: str = username
|
self.username: str = username
|
||||||
self.password: str = password
|
self.password: str = password
|
||||||
|
self.disable_cert_verify: bool = disable_cert_verify
|
||||||
|
|
||||||
def _get_params(self) -> Dict[str, str]:
|
def _get_params(self) -> Dict[str, str]:
|
||||||
"""See Subsonic API Introduction for details."""
|
"""See Subsonic API Introduction for details."""
|
||||||
@@ -89,7 +97,11 @@ class Server:
|
|||||||
if type(v) == datetime:
|
if type(v) == datetime:
|
||||||
params[k] = int(cast(datetime, v).timestamp() * 1000)
|
params[k] = int(cast(datetime, v).timestamp() * 1000)
|
||||||
|
|
||||||
result = requests.get(url, params=params)
|
result = requests.get(
|
||||||
|
url,
|
||||||
|
params=params,
|
||||||
|
verify=not self.disable_cert_verify,
|
||||||
|
)
|
||||||
# TODO make better
|
# TODO make better
|
||||||
if result.status_code != 200:
|
if result.status_code != 200:
|
||||||
raise Exception(f'[FAIL] get: {url} status={result.status_code}')
|
raise Exception(f'[FAIL] get: {url} status={result.status_code}')
|
||||||
|
@@ -23,6 +23,7 @@ class EditServerDialog(EditFormDialog):
|
|||||||
boolean_fields = [
|
boolean_fields = [
|
||||||
('Browse by tags', 'browse_by_tags'),
|
('Browse by tags', 'browse_by_tags'),
|
||||||
('Sync enabled', 'sync_enabled'),
|
('Sync enabled', 'sync_enabled'),
|
||||||
|
('Do not verify certificate', 'disable_cert_verify'),
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@@ -209,6 +210,8 @@ class ConfigureServersDialog(Gtk.Dialog):
|
|||||||
password=dialog.data['password'].get_text(),
|
password=dialog.data['password'].get_text(),
|
||||||
browse_by_tags=dialog.data['browse_by_tags'].get_active(),
|
browse_by_tags=dialog.data['browse_by_tags'].get_active(),
|
||||||
sync_enabled=dialog.data['sync_enabled'].get_active(),
|
sync_enabled=dialog.data['sync_enabled'].get_active(),
|
||||||
|
disable_cert_verify=dialog.data['disable_cert_verify']
|
||||||
|
.get_active(),
|
||||||
)
|
)
|
||||||
|
|
||||||
if add:
|
if add:
|
||||||
|
Reference in New Issue
Block a user