Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
Nokse22 committed Apr 9, 2024
1 parent 90461fb commit 26feba3
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 7 deletions.
39 changes: 39 additions & 0 deletions io.github.nokse22.high-tide.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,45 @@
"*.a"
],
"modules" : [
{
"name": "python3-mpris_server",
"buildsystem": "simple",
"build-commands": [
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"mpris_server\" --no-build-isolation"
],
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/84/b7/6ec57841fb67c98f52fc8e4a2d96df60059637cba077edc569a302a8ffc7/Unidecode-1.3.8-py3-none-any.whl",
"sha256": "d130a61ce6696f8148a3bd8fe779c99adeb4b870584eeb9526584e9aa091fd39"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/68/8a/b08dd0b946f0843cba782e3784cd979c33f144e5e7c37fb0162dc47acd43/emoji-1.7.0.tar.gz",
"sha256": "65c54533ea3c78f30d0729288998715f418d7467de89ec258a31c0ce8660a1d1"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/b0/46/28c2ea8b0f338400fc821c938dd15d6c4c9564c6198ff9fd09bfd9b7b0ea/mpris_server-0.4.2-py2.py3-none-any.whl",
"sha256": "4b34e732f6f0c6b9a6a03d3a3d9962a5e538c67ddda2051991216a1bae626ec0"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/1c/41/91955188e97c7b85fbaac6bbf4e33de028899e0aa31bdce99b1afe2eeb17/pycairo-1.26.0.tar.gz",
"sha256": "2dddd0a874fbddb21e14acd9b955881ee1dc6e63b9c549a192d613a907f9cbeb"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/92/56/27148014c2f85ce70332f18612f921f682395c7d4e91ec103783be4fce00/pydbus-0.6.0-py2.py3-none-any.whl",
"sha256": "66b80106352a718d80d6c681dc2a82588048e30b75aab933e4020eb0660bf85e"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/f9/9e/6bab1ed3bd878f0912d9a0600c21f3d88bab0e8a8d4c3ce50f5cf336faaf/pygobject-3.48.2.tar.gz",
"sha256": "c3c0a7afbe5b2c1c64dc0530109b4dd571085153dbedfbccb8ec7c5ad233f977"
}
]
},
{
"name" : "python3-requests",
"buildsystem" : "simple",
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project('tidal',
project('high-tide',
version: '0.1.0',
meson_version: '>= 0.62.0',
default_options: [ 'warning_level=2', 'werror=false', ],
Expand Down
2 changes: 2 additions & 0 deletions src/lib/player_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def get_track_list(self, thing): # Converts albums, playlists, mixes in a list o
tracks = thing.tracks()
elif isinstance(thing, Playlist):
tracks = thing.tracks()
elif isinstance(thing, Artist):
tracks = thing.top_tracks()
else: # For radios
tracks = thing

Expand Down
4 changes: 2 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
gi.require_version('Gst', '1.0')

from gi.repository import Gtk, Gio, Adw, Gdk
from .window import TidalWindow
from .window import HighTideWindow

from tidalapi.media import Quality

Expand Down Expand Up @@ -159,7 +159,7 @@ def do_activate(self):
"""
self.win = self.props.active_window
if not self.win:
self.win = TidalWindow(application=self)
self.win = HighTideWindow(application=self)
self.win.present()

def on_about_action(self, widget, _):
Expand Down
3 changes: 2 additions & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gnome.compile_resources('high-tide',
python = import('python')

conf = configuration_data()
conf.set('PYTHON', python.find_installation('python3').path())
conf.set('PYTHON', python.find_installation('python3').full_path())
conf.set('VERSION', meson.project_version())
conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir')))
conf.set('pkgdatadir', pkgdatadir)
Expand All @@ -31,6 +31,7 @@ tidal_sources = [
'main.py',
'window.py',
'login.py',
'mpris.py',
]

install_data(tidal_sources, install_dir: moduledir)
Expand Down
15 changes: 13 additions & 2 deletions src/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@

from gi.repository import Gst, GLib

from .mpris import Adapter
from mpris_server.adapters import MprisAdapter
from mpris_server.events import EventAdapter
from mpris_server.server import Server
from mpris_server import Metadata

import base64
import json

Expand Down Expand Up @@ -57,8 +63,8 @@
from .widgets.generic_track_widget import GenericTrackWidget

@Gtk.Template(resource_path='/io/github/nokse22/high-tide/window.ui')
class TidalWindow(Adw.ApplicationWindow):
__gtype_name__ = 'TidalWindow'
class HighTideWindow(Adw.ApplicationWindow):
__gtype_name__ = 'HighTideWindow'

# homepage_box = Gtk.Template.Child()
split_view = Gtk.Template.Child()
Expand Down Expand Up @@ -114,6 +120,11 @@ def __init__(self, **kwargs):

self.select_quality(self.settings.get_int("quality"))

mpris = Server('high-tide', adapter=Adapter())
# player.mpris_adapter = EventAdapter(root=mpris.root, player=mpris.player)
# player.mpris_server = mpris
mpris.publish()

self.current_mix = None
self.player_object.current_song_index = 0
self.previous_time = 0
Expand Down
2 changes: 1 addition & 1 deletion src/window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<interface>
<requires lib="gtk" version="4.0"/>
<requires lib="Adw" version="1.0"/>
<template class="TidalWindow" parent="AdwApplicationWindow">
<template class="HighTideWindow" parent="AdwApplicationWindow">
<property name="default-width">800</property>
<property name="default-height">600</property>
<property name="width-request">360</property>
Expand Down

0 comments on commit 26feba3

Please sign in to comment.