lejacobroy / Tidalrr

Self-hosted Tidal library sync
Apache License 2.0
31 stars 4 forks source link

lidarr sync fails #11

Open ramonskie opened 8 months ago

ramonskie commented 8 months ago

i have a clean lidarr setup with 1 artist in it

when starting the lidarr sync it will result in the following error

2024-02-26 14:34:34 Starting scans
LOG: Running job "startLidarrSync"
2024-02-26 14:34:34 startLidarrSync
Non-Empty Access Token, logging in
tidalrrStart
Error getting missing albums:  Expecting value: line 1 column 1 (char 0)
Process Process-1:
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/app/tidalrr/workers/__init__.py", line 25, in wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/app/runLidarrNow.py", line 23, in startLidarrSync
    syncLidarr()
  File "/app/tidalrr/workers/syncLidarr.py", line 18, in syncLidarr
    albums = getMissingAlbums(settings.lidarrUrl, settings.lidarrApi)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/tidalrr/workers/syncLidarr.py", line 41, in getMissingAlbums
    while result['records']!= []:
          ~~~~~~^^^^^^^^^^^
TypeError: string indices must be integers, not 'str'

is it correct to assum that the lidarr intergration is not ready to use yet. or is this a new bug

lejacobroy commented 8 months ago

From the error log, it seems like Tidalrr cannot connect to your Lidarr instance.

To further test the connection, try to manually access the Lidarr API endpoint using this URL with your browser LIDARR_URL/api/v1/wanted/missing?apikey=LIDARR_API_KEY&pageSize=10&page=1 Replacing LIDARR_URL with your Lidarr server URL, for example http://100.84.146.8:8686 and LIDARR_API_KEY with your Lidar API Key (a bunch of characters and numbers)

They should both be set into the Tidalrr Settings page.

Also, in Lidarr, you need to have Monitored and Missing albums. It's the only thing that Tidalrr can sync.

ramonskie commented 8 months ago

a small excerpt of what i got when running a curl command from within the container.

{
  "page": 1,
  "pageSize": 10,
  "sortKey": "releaseDate",
  "sortDirection": "descending",
  "totalRecords": 531,
  "records": [
    {
      "title": "This Is Me…Now",
      "disambiguation": "",
      "overview": "This Is Me... Now is the ninth studio album by American entertainer Jennifer Lopez. It was released....\n\n",
      "artistId": 18,
      "foreignAlbumId": "c208690a-d2d2-43c0-91f8-c3ad4b543214",
      "monitored": true,
      "anyReleaseOk": true,
      "profileId": 1,
      "duration": 3206000,
      "albumType": "Album",
      "secondaryTypes": [],
      "mediumCount": 1,
      "ratings": {
        "votes": 0,
        "value": 0
      },
      "releaseDate": "2024-02-16T00:00:00Z",
      "releases": [
        {
          "id": 1096,
          "albumId": 535,
          "foreignReleaseId": "087fd0dd-4df2-4cf2-9e85-b6fc69100873",
          "title": "This Is Me…Now",
          "status": "Official",
          "duration": 2662000,
          "trackCount": 13,
          "media": [
            {
              "mediumNumber": 1,
              "mediumName": "",
              "mediumFormat": "Digital Media"
            }
          ],
          "mediumCount": 1,
          "disambiguation": "",
          "country": [
            "[Worldwide]"
          ],
          "label": [
            "BMG"
          ],
          "format": "Digital Media",
          "monitored": false
        },
        {
          "id": 1097,
          "albumId": 535,
          "foreignReleaseId": "f2a5c6b4-d6a9-4298-b978-b1f65ea88e43",
          "title": "This Is Me…Now",
          "status": "Official",
          "duration": 3238133,
          "trackCount": 16,
          "media": [
            {
              "mediumNumber": 1,
              "mediumName": "",
              "mediumFormat": "Digital Media"
            }
          ],
          "mediumCount": 1,
          "disambiguation": "deluxe",
          "country": [
            "[Worldwide]"
          ],
          "label": [
            "BMG"
          ],
          "format": "Digital Media",
          "monitored": false
        },
lejacobroy commented 8 months ago

Great, thank you for the log. So indeed your Lidarr server is correctly configured and is reporting missing albums - perfect!

I will refactor the syncLidarr.py file to have better error catching and try to reproduce the problem on my end based on your JSON excerpt.

ramonskie commented 8 months ago

a linke to the whole json output https://pastebin.com/8uNcp7b6

zaheria985 commented 7 months ago

Same issues here. Any updates?

Robert-Janssen commented 4 months ago

I have another lidarr sync error. Don't know if it needs a new issue or if I can add it here. But I get a error about the '-' /u2010 character.

Process Process-1: Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1264.0_x64__qbz5n2kfra8p0\Lib\multiprocessing\process.py", line 314, in _bootstrap self.run() File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1264.0_x64__qbz5n2kfra8p0\Lib\multiprocessing\process.py", line 108, in run self._target(*self._args, **self._kwargs) File "D:\Users\Robert\Servarr\Tidalrr\tidalrr\workers\__init__.py", line 35, in wrapper result = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:\Users\Robert\Servarr\Tidalrr\runLidarrNow.py", line 22, in startLidarrSync syncLidarr() File "D:\Users\Robert\Servarr\Tidalrr\tidalrr\workers\syncLidarr.py", line 28, in syncLidarr start_album_search(album) File "D:\Users\Robert\Servarr\Tidalrr\tidalrr\workers\syncLidarr.py", line 80, in start_album_search album = TIDAL_API.searchAlbum(alb) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Users\Robert\Servarr\Tidalrr\tidalrr\tidal.py", line 398, in searchAlbum print('no album matched for album: ' + obj['artist'] + ' - '+ str(obj['title'])) File "C:\Users\rober\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\colorama\ansitowin32.py", line 47, in write self.__convertor.write(text) File "C:\Users\rober\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\colorama\ansitowin32.py", line 177, in write self.write_and_convert(text) File "C:\Users\rober\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\colorama\ansitowin32.py", line 205, in write_and_convert self.write_plain_text(text, cursor, len(text)) File "C:\Users\rober\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\colorama\ansitowin32.py", line 210, in write_plain_text self.wrapped.write(text[start:end]) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1264.0_x64__qbz5n2kfra8p0\Lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeEncodeError: 'charmap' codec can't encode character '\u2010' in position 61: character maps to <undefined>

Erieg1969 commented 2 months ago

I am having this issue. Is there an update?

Tephea1405 commented 1 month ago

I was having the same sync issue as the original post.

Initially, I set my Lidarr URL to "IP:PORT". Changing the Lidarr server URL to "http://IP:PORT" solved the issue. Ensure no trailing slash.

Erieg1969 commented 1 month ago

I had a trailing slash. Thank you!!! On Sep 7, 2024 at 1:27 PM -0600, Tephea1405 @.***>, wrote:

I was having the same sync issue as the original post. Initially, I set my Lidarr URL to "IP:PORT". Changing the Lidarr server URL to "http://IP:PORT" solved the issue. Ensure no trailing slash. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>