nate-xyz / resonance

Intuitive GTK4/LibAdwaita music player
https://beta.flathub.org/apps/io.github.nate_xyz.Resonance
GNU General Public License v3.0
363 stars 20 forks source link

Thread panic when importing my own recordings #96

Open Tuba2 opened 1 year ago

Tuba2 commented 1 year ago

Context

I am a singer-songwriter and I am trying to add a folder with my own songs to Resonance.

However, the app doesn't seem to do well with song data/tags that is not in the database it seems to check against.

I even tried to check with a different set of personal recordings, and it recognized some, but I didn't quite understand why.

What I expected to happen

My songs would be added to my Resonance library, with their custom tags.

What happened

The app gets stuck loading the added files forever.

Steps to reproduce

1 - Start a new database 2 - Try to add a folder with personal recordings (mine were in .wav format) to your database

Logs & Info

Here you can see the output for when I try to add the folder with my own recordings, with proper tags:

[luizfilipemotta@fedora-do-tuba ~]$ flatpak run io.github.nate_xyz.Resonance
 DEBUG resonance > Loading resources
 DEBUG resonance::database > The current directory is /home/luizfilipemotta
 DEBUG resonance::database > music-folders = []
 ERROR resonance::web::discord > Unable to connect to discord client: Couldn't connect to the Discord IPC socket
 DEBUG resonance::web::last_fm > Last.FM disabled.
 DEBUG resonance::views::pages::albums::album_sidebar::imp > AlbumFlap constructed
 DEBUG resonance::views::control_bar                       > bind_state
 DEBUG resonance::views::window                            > bind signals
 DEBUG resonance::database                                 > database path: "/home/luizfilipemotta/.var/app/io.github.nate_xyz.Resonance/data/io.github.nate_xyz.Resonance/resonance.db"
 DEBUG resonance::database                                 > open new database
 DEBUG resonance::database                                 > sqlite_source_id: 2022-09-05 11:02:23 4635f4a69c8c2a8df242b384a992aea71224e39a2ccab42d8c0b0602f1e826e8
 DEBUG resonance::database                                 > No new artists
 DEBUG resonance::database                                 > No folders, but opened connection to db.
 DEBUG resonance::database::imp                            > setting loaded: false
 DEBUG resonance::views::window                            > Notified database loaded in window.
 DEBUG resonance::views::window                            > DIALOG FOLDER RECEIVED: "/run/user/1000/doc/f7b4ab9/Músicas"
importing
 DEBUG resonance::importer                                 > 2023-04-28 03:53:19.891 | DEBUG    | :<module>:8 - in python main

 DEBUG resonance::importer                                 > 2023-04-28 03:53:19.891 | DEBUG    | importer:__init__:24 - Importer init

 DEBUG resonance::importer                                 > 2023-04-28 03:53:19.891 | DEBUG    | :tags_and_cover_art:12 - retrieving tags & cover art from: /run/user/1000/doc/f7b4ab9/Músicas

 DEBUG resonance::importer                                 > 2023-04-28 03:53:19.892 | DEBUG    | importer:load_folder_both:47 -    load_folder

 DEBUG resonance::importer                                 > 2023-04-28 03:53:19.893 | DEBUG    | importer:get_both:57 -    get_metadata

 DEBUG resonance::importer                                 > 2023-04-28 03:53:19.893 | DEBUG    | importer:get_both:63 -    get_metadata -> retrieving mutagen files

 DEBUG resonance::importer                                 > 2023-04-28 03:53:19.905 | DEBUG    | importer:get_both:67 - get_metadata -> getting coverart from mutagen files

 DEBUG resonance::importer                                 > retrieving tags & cover art ... 
 ERROR resonance::importer                                 > Nothing extracted.
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: ImportError("Tag Map Empty")', src/importer.rs:148:25
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[luizfilipemotta@fedora-do-tuba ~]$ flatpak run io.github.nate_xyz.Resonance
 DEBUG resonance > Loading resources
 DEBUG resonance::database > The current directory is /home/luizfilipemotta
 DEBUG resonance::database > music-folders = []
 ERROR resonance::web::discord > Unable to connect to discord client: Couldn't connect to the Discord IPC socket
 DEBUG resonance::web::last_fm > Last.FM disabled.
 DEBUG resonance::views::pages::albums::album_sidebar::imp > AlbumFlap constructed
 DEBUG resonance::views::control_bar                       > bind_state
 DEBUG resonance::views::window                            > bind signals
 DEBUG resonance::database                                 > database path: "/home/luizfilipemotta/.var/app/io.github.nate_xyz.Resonance/data/io.github.nate_xyz.Resonance/resonance.db"
 DEBUG resonance::database                                 > open new database
 DEBUG resonance::database                                 > sqlite_source_id: 2022-09-05 11:02:23 4635f4a69c8c2a8df242b384a992aea71224e39a2ccab42d8c0b0602f1e826e8
 DEBUG resonance::database                                 > No new artists
 DEBUG resonance::database                                 > No folders, but opened connection to db.
 DEBUG resonance::database::imp                            > setting loaded: false
 DEBUG resonance::views::window                            > Notified database loaded in window.
 DEBUG resonance::views::window                            > DIALOG FOLDER RECEIVED: "/run/user/1000/doc/f7b4ab9/Músicas"
importing
 DEBUG resonance::importer                                 > 2023-04-28 03:53:19.891 | DEBUG    | :<module>:8 - in python main

 DEBUG resonance::importer                                 > 2023-04-28 03:53:19.891 | DEBUG    | importer:__init__:24 - Importer init

 DEBUG resonance::importer                                 > 2023-04-28 03:53:19.891 | DEBUG    | :tags_and_cover_art:12 - retrieving tags & cover art from: /run/user/1000/doc/f7b4ab9/Músicas

 DEBUG resonance::importer                                 > 2023-04-28 03:53:19.892 | DEBUG    | importer:load_folder_both:47 -    load_folder

 DEBUG resonance::importer                                 > 2023-04-28 03:53:19.893 | DEBUG    | importer:get_both:57 -    get_metadata

 DEBUG resonance::importer                                 > 2023-04-28 03:53:19.893 | DEBUG    | importer:get_both:63 -    get_metadata -> retrieving mutagen files

 DEBUG resonance::importer                                 > 2023-04-28 03:53:19.905 | DEBUG    | importer:get_both:67 - get_metadata -> getting coverart from mutagen files

 DEBUG resonance::importer                                 > retrieving tags & cover art ... 
 ERROR resonance::importer                                 > Nothing extracted.
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: ImportError("Tag Map Empty")', src/importer.rs:148:25
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

And here you can see the output when I try to add the folder with a different set of recordings, mostly untagged:

[luizfilipemotta@fedora-do-tuba ~]$ flatpak run io.github.nate_xyz.Resonance
 DEBUG resonance > Loading resources
 DEBUG resonance::database > The current directory is /home/luizfilipemotta
 DEBUG resonance::database > music-folders = []
 ERROR resonance::web::discord > Unable to connect to discord client: Couldn't connect to the Discord IPC socket
 DEBUG resonance::web::last_fm > Last.FM disabled.
 DEBUG resonance::views::pages::albums::album_sidebar::imp > AlbumFlap constructed
 DEBUG resonance::views::control_bar                       > bind_state
 DEBUG resonance::views::window                            > bind signals
 DEBUG resonance::database                                 > database path: "/home/luizfilipemotta/.var/app/io.github.nate_xyz.Resonance/data/io.github.nate_xyz.Resonance/resonance.db"
 DEBUG resonance::database                                 > open new database
 DEBUG resonance::database                                 > sqlite_source_id: 2022-09-05 11:02:23 4635f4a69c8c2a8df242b384a992aea71224e39a2ccab42d8c0b0602f1e826e8
 DEBUG resonance::database                                 > No new artists
 DEBUG resonance::database                                 > No folders, but opened connection to db.
 DEBUG resonance::database::imp                            > setting loaded: false
 DEBUG resonance::views::window                            > Notified database loaded in window.
 DEBUG resonance::views::window                            > DIALOG FOLDER RECEIVED: "/run/user/1000/doc/4461f0b7/Teste"
importing
 DEBUG resonance::importer                                 > 2023-04-28 03:41:23.714 | DEBUG    | :<module>:8 - in python main

 DEBUG resonance::importer                                 > 2023-04-28 03:41:23.714 | DEBUG    | importer:__init__:24 - Importer init

 DEBUG resonance::importer                                 > 2023-04-28 03:41:23.714 | DEBUG    | :tags_and_cover_art:12 - retrieving tags & cover art from: /run/user/1000/doc/4461f0b7/Teste

 DEBUG resonance::importer                                 > 2023-04-28 03:41:23.714 | DEBUG    | importer:load_folder_both:47 -    load_folder

 DEBUG resonance::importer                                 > 2023-04-28 03:41:23.715 | DEBUG    | importer:get_both:57 -    get_metadata

 DEBUG resonance::importer                                 > 2023-04-28 03:41:23.716 | DEBUG    | importer:get_both:63 -    get_metadata -> retrieving mutagen files

 DEBUG resonance::importer                                 > 2023-04-28 03:41:23.725 | DEBUG    | importer:get_both:67 - get_metadata -> getting coverart from mutagen files

 ERROR resonance::importer                                 > 2023-04-28 03:41:23.726 | ERROR    | importer:get_both:81 - exception on cover art extract: /run/user/1000/doc/4461f0b7/Teste/Foi_e_Sera_-_Demo.mp3

 ERROR resonance::importer                                 > 2023-04-28 03:41:23.726 | ERROR    | importer:get_both:83 - ['Traceback (most recent call last):\n', '  File "importer", line 71, in get_both\n', '  File "extracting", line 80, in translate_and_cover_art\n', '  File "extracting", line 203, in cover_art\n', '  File "extracting", line 261, in extract_coverart\n', "AttributeError: 'NoneType' object has no attribute 'keys'\n"]

 ERROR resonance::importer                                 > 2023-04-28 03:41:23.727 | ERROR    | importer:get_both:81 - exception on cover art extract: /run/user/1000/doc/4461f0b7/Teste/Eu_Nao_Sei_Agradecer_Tranquilo.mp3

 ERROR resonance::importer                                 > 2023-04-28 03:41:23.727 | ERROR    | importer:get_both:83 - ['Traceback (most recent call last):\n', '  File "importer", line 71, in get_both\n', '  File "extracting", line 80, in translate_and_cover_art\n', '  File "extracting", line 203, in cover_art\n', '  File "extracting", line 261, in extract_coverart\n', "AttributeError: 'NoneType' object has no attribute 'keys'\n"]

 DEBUG resonance::importer                                 > retrieving tags & cover art ... 
 ERROR resonance::importer                                 > Nothing extracted.
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: ImportError("Tag Map Empty")', src/importer.rs:148:25
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

In case you need anything else to properly debug/fix it, let me know. I'll be happy to help!