Tidal App discussion

This thread is intended for discussion of development of the music app by @contra for use with the tidal.com service

Reference:

7 Likes

Great :slight_smile:

Next week I will have a look at my old code and will outline what I did and what worked and so on.

So far:
After manual login (that was tricky, had to be redone once a week), I was able to look for tracks, albums and artists, extract the urls of the tracks and cover art and feed them into an own playlistmanager. I was not aware of the stuff qmultimedia (?) was capable of.

And of course, everything is written in C++ using PyObject to interact with the API.

Edit: I forgot to mention, that listening to the tracks/albums etc worked then :slight_smile:

7 Likes

What I really like about Tidal is the (for my needs) amazingly good recommendation algorithm. I love the “My Daily Discovery” playlist. I’ve often discovered good artists that were new to me. Of course, you have to be pretty conscientious about giving out “likes”. And you need to be able to block artists.
That would be wish features :wink:

Unfortunately, I really can not contribute much, I have installed the SDK and no idea what to do further now :wink: So other than testing I can’t offer any contribution so far, unfortunately.

1 Like

Well, that’s easy.

  1. git clone GitHub - conradhuebler/harbour-tidalplayer
  2. open the harbour-tidalplayer.pro file in the sdk
  3. build it

Ok, I’m only half kidding, but, setting up your device (via Developer settings and the device setup in the SDK) and your a compile away from building directly to your phone. It’s fun :slight_smile:

Well, yes. But just building doesn’t help in improving the app :wink:

Yeah, like I said, half kidding.

Since the python api is in play, I’d consider reworking it with python instead of c++ since it’s less work in the long run. It’s more work at the outset and some parts in c++ would probably still make sense.

Using io.thp.pyotherside would probably make development more attractive to developers who do stuff llike python on device development, people with scripting experience who shy away from the compiler.

1 Like

At least I used some very basic Python stuff for my Master Thesis, so yes, sounds more attractive :wink:

But anyway, I guess in the near future I can’t offer more help than testing, maybe that might change some day…

So, I have now been working on the app (again).

I run into following problem: The most recent version of tidalapi needs Python 3.9 or newer but on SFOS there is only 3.8. I could use an older tidalapi version but I ran into trouble during login (Tidal no longer includes gender attribute for user user object · Issue #159 · tamland/python-tidal · GitHub).

Removing the specific line in the api works around this, but this somehow not nice. Will there be an update for python in future SFOS release? Does anyone know?

As soon I have a (worked-around) login procedure, I will commit the current changes.

4 Likes

They might change master branch to main or control-plane (Reddit - Dive into anything) or add required pronoun attribute, abandon ship not really applicable, I guess it’s just tidal not caring about third party apps, the api reversers seem fine as they even dropped the useless extra stuff: fix: drop almost all user data we don't use. by 2e0byo · Pull Request #149 · tamland/python-tidal · GitHub
edit: this has a nicer workaround this api change getting KeyError: 'gender' since this morning... · Issue #146 · tamland/python-tidal · GitHub

2 Likes

So, I just listened the first time to a song via the upcoming tidal player for SFOS. There are still many things to do in order to not just listen to a single song but:

Login via OAuth works (via WebView)
Storing login works (via Nemo.Configuration 1.0)
Search for Tracks, Albums, Artists is managable
Listing to a single song via retrieving the URL using the API works now.

In the previous version, I wrote a playlistmanager in C++ which I dropped as everything is now python. So I have to reimplement something like that and then I would be usable as a pre-alpha.

5 Likes

As I have trouble adding another device to the SDK (Volla 22 is recognised but I can never choose it), I can not test the login procedure without being logged in before.

However, with the latest commit (some commit · conradhuebler/harbour-tidalplayer@3a70d12 · GitHub), testing the current stage would be possible with the SDK as described (Tidal App discussion - #4 by poetaster).

Btw, does anyone know why the lateset SDK (3.10.4) gives an error since the no repo could be reached? I am stuck with an older SDK version.

1 Like

I can deploy to Volla22(GS5/rephone), but QML live testing is broken. I’ll test build/deploy later and report.

Which version of the SDK do you have? It might simply not be possible to upgrade with ‘many’ versions between.

After commiting I managed to deploy to volla 22. Some packages are missing in the yml fike, so it would not work out of the box. But maybe tonight …

3 Likes

If I recall correctly, I tried it even with no version installed. But I am able to test the app on Volla 22 too so I don’t need to worry about the SDK.

With the latest commit, I think the first people find it even usefull to listen to specific songs.

So I suppose, a tidal app really is possible but for now I don’t know if the listend songs will be tracked in the statistic of tidal. At least not by resolving the track url.

As I am not really familiar with pyotherside, does anyone know if and how one can access python variables or function results from a qml file? Currently, I manage everything with handlers.

Have a look at Neliapila’s source code for an example: https://github.com/tabasku/harbour-neliapila/blob/master/qml/pages/ThreadsPage.qml, you 'setHandler’s waiting for python results and are able to process them then and ‘call’ functions straight from QML, not sure if there is less cluttered example out there, but python-qml part starts at line 352

1 Like

I think I am too stupid. I was trying to build the app myself, but I don’t get it where to put the tidalapi. If I just install it regularly on my computer I get something like this (leading output removed):

+ mkdir /home/deploy/installroot/usr/share/harbour-tidalplayer/python
+ cp -r python/tidalapi /home/deploy/installroot/usr/share/harbour-tidalplayer/python/tidalapi
cp: cannot stat 'python/tidalapi': No such file or directory


RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.UF51tV (%install)
    Bad exit status from /var/tmp/rpm-tmp.UF51tV (%install)
05:36:58: The process "/home/XXX/SailfishOS/bin/sfdk" exited with code 1.
Error while building/deploying project harbour-tidalplayer (kit: SailfishOS-4.5.0.18-i486 (in Sailfish SDK Build Engine))
When executing step "RPM Build"

What am I doing wrong? What do I have to do with the tidalapi to be available?

It should be in python/tidalapi under your build directory.

Thanks for the answer. I already tried it, but maybe I made a mistake. By build directory you mean something like /home/XXX/SFOS-devel/harbour-tidalplayer on the hosting system where I put the files of the project (of course depending on the real path), right?

That would be your source directory. Which might be also your build directory as well. If you are using sfdk for building, the build directory is the one you are running the build command from.

If you use the IDE for building, it will by default create a separate build directory. This behaviour can be controlled in the project settings, it’s called “shadow build”.

2 Likes