0xzer0x / quran-companion

Free and open-source desktop Quran reader and player 💻
https://0xzer0x.github.io/projects/quran-companion/
Other
106 stars 10 forks source link

Selected tafseer is missing #97

Closed aryo-sr closed 2 months ago

aryo-sr commented 2 months ago

The problem

I have downloaded some tafseer from download manager, but everytime I want to read the tafseer from menu View - Tafsir, a popup appear suggesting to download tafseer as it's missing.

Release version

1.2.9 (flatpak)

Operating system

Linux (openSUSE Tumbleweed-based)

Steps to reproduce the behavior

  1. Download a tafseer
  2. Go to View - Tafsir
  3. Popup appear stating missing tafseer

Log files

[Fri Aug 30 06:53:49 2024][WARNING] Couldn't load VAAPI library  file:  line: 0
[Fri Aug 30 06:53:49 2024][CRITICAL] verseIdxInPage is out of page coords range!!!  file:  line: 0
[Fri Aug 30 06:53:49 2024][DEBUG] "file 094007.mp3 is missing."  file:  line: 0
[Fri Aug 30 06:53:49 2024][INFO] Migrating old staterc "" -> "/home/aryo/.var/app/io.github._0xzer0x.qurancompanion/.local/state/Quran Companionstaterc"  file: /run/build-runtime/kconfig/src/core/ksharedconfig.cpp line: 101
[Fri Aug 30 06:53:49 2024][WARNING] QFile::rename: Empty or null file name  file:  line: 0
[Fri Aug 30 06:53:49 2024][WARNING] Failed to migrate "" -> "/home/aryo/.var/app/io.github._0xzer0x.qurancompanion/.local/state/Quran Companionstaterc"  file: /run/build-runtime/kconfig/src/core/ksharedconfig.cpp line: 103
[Fri Aug 30 06:53:49 2024][WARNING] QObject::connect: No such signal Solid::Backends::Fstab::FstabStorageAccess::repairRequested(QString) in /run/build-runtime/solid/src/solid/devices/frontend/storageaccess.cpp:23  file:  line: 0
[Fri Aug 30 06:53:49 2024][WARNING] QObject::connect: No such signal Solid::Backends::Fstab::FstabStorageAccess::repairDone(Solid::ErrorType, QVariant, QString) in /run/build-runtime/solid/src/solid/devices/frontend/storageaccess.cpp:24  file:  line: 0
[Fri Aug 30 06:53:49 2024][WARNING] Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected" 
 "Not connected to D-Bus server"  file: /run/build-runtime/solid/src/solid/devices/backends/udisks2/udisksmanager.cpp line: 160
[Fri Aug 30 06:53:49 2024][WARNING] Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected" 
 "Not connected to D-Bus server"  file: /run/build-runtime/solid/src/solid/devices/backends/udisks2/udisksmanager.cpp line: 160
[Fri Aug 30 06:53:49 2024][WARNING] Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected" 
 "Not connected to D-Bus server"  file: /run/build-runtime/solid/src/solid/devices/backends/udisks2/udisksmanager.cpp line: 160
[Fri Aug 30 06:53:49 2024][WARNING] Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected" 
 "Not connected to D-Bus server"  file: /run/build-runtime/solid/src/solid/devices/backends/udisks2/udisksmanager.cpp line: 160
[Fri Aug 30 06:53:49 2024][WARNING] Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected" 
 "Not connected to D-Bus server"  file: /run/build-runtime/solid/src/solid/devices/backends/udisks2/udisksmanager.cpp line: 160
[Fri Aug 30 06:53:49 2024][WARNING] Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected" 
 "Not connected to D-Bus server"  file: /run/build-runtime/solid/src/solid/devices/backends/udisks2/udisksmanager.cpp line: 160
[Fri Aug 30 06:53:49 2024][WARNING] Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected" 
 "Not connected to D-Bus server"  file: /run/build-runtime/solid/src/solid/devices/backends/udisks2/udisksmanager.cpp line: 160
[Fri Aug 30 06:53:49 2024][WARNING] Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected" 
 "Not connected to D-Bus server"  file: /run/build-runtime/solid/src/solid/devices/backends/udisks2/udisksmanager.cpp line: 160

Screenshots

Screenshot_30065302_1

Additional context

No response

0xzer0x commented 2 months ago

Downloads path?

aryo-sr commented 2 months ago

Downloads path?

It's ~/.var/app/io.github._0xzer0x.qurancompanion/data/QuranCompanion/ from clicking on Downloads button at download manager window.

0xzer0x commented 2 months ago

It might be a Flatpak specific issue. Unfortunately, I can't reproduce it. Does running flatpak override --system-talk-name=org.freedesktop.UDisks2 io.github._0xzer0x.qurancompanion fix the issue?

aryo-sr commented 2 months ago

It does resolve the DBus errors, but the main issue persists. The qc.log content is as follow:

[Sat Aug 31 10:38:06 2024][WARNING] Couldn't load VAAPI library  file:  line: 0
[Sat Aug 31 10:38:06 2024][CRITICAL] verseIdxInPage is out of page coords range!!!  file:  line: 0
[Sat Aug 31 10:38:06 2024][DEBUG] "file 093001.mp3 is missing."  file:  line: 0
[Sat Aug 31 10:38:06 2024][INFO] Migrating old staterc "" -> "/home/aryo/.var/app/io.github._0xzer0x.qurancompanion/.local/state/Quran Companionstaterc"  file: /run/build-runtime/kconfig/src/core/ksharedconfig.cpp line: 101
[Sat Aug 31 10:38:06 2024][WARNING] QFile::rename: Empty or null file name  file:  line: 0
[Sat Aug 31 10:38:06 2024][WARNING] Failed to migrate "" -> "/home/aryo/.var/app/io.github._0xzer0x.qurancompanion/.local/state/Quran Companionstaterc"  file: /run/build-runtime/kconfig/src/core/ksharedconfig.cpp line: 103
[Sat Aug 31 10:38:06 2024][WARNING] QObject::connect: No such signal Solid::Backends::Fstab::FstabStorageAccess::repairRequested(QString) in /run/build-runtime/solid/src/solid/devices/frontend/storageaccess.cpp:23  file:  line: 0
[Sat Aug 31 10:38:06 2024][WARNING] QObject::connect: No such signal Solid::Backends::Fstab::FstabStorageAccess::repairDone(Solid::ErrorType, QVariant, QString) in /run/build-runtime/solid/src/solid/devices/frontend/storageaccess.cpp:24  file:  line: 0
[Sat Aug 31 10:38:29 2024][WARNING] QSqlQuery::value: not positioned on a valid record  file:  line: 0
[Sat Aug 31 10:38:30 2024][WARNING] Failed to compute left/right minimum bearings for "QCF2598"  file:  line: 0
..........
[Sat Aug 31 10:38:30 2024][WARNING] Failed to compute left/right minimum bearings for "QCF2598"  file:  line: 0
[Sat Aug 31 10:38:30 2024][WARNING] QSqlQuery::value: not positioned on a valid record  file:  line: 0
aryo-sr commented 2 months ago

Okay, I kind of found the root cause of this issue. It's likely because of the Reader/Tafsir config is wrongly pointing to the tafsir DB file, which in my case it hasn't been downloaded yet. Screenshot_31112551_1 But actually, @0xzer0x how do you save the tafsir config value while the option is absent in the preference dialog? I change the config file manually by setting Tafsir=16, which points to jalalayn_en.db file. Hence, the tafsir dialog now is opened.

0xzer0x commented 2 months ago

The tafsir config is saved based on the last tafsir chosen in the content dialog since it is only visible there.

0xzer0x commented 2 months ago

I think the issue is due to the application trying to load a different tafsir than the one previously set. This is because the tafsir config is dependent on the ordering of the tafsir in the resources/files.xml, so the mapping between an index and a tafsir changes when adding new content. This should be fixed in f22ae65b11202ec0538d7bd78463603426f1a803.

aryo-sr commented 2 months ago

Thank you @0xzer0x , now it's clear enough. As I assumed, it's initially set a default value of the tafseer for the config, as defined in this line https://github.com/0xzer0x/quran-companion/blob/f22ae65b11202ec0538d7bd78463603426f1a803/src/utils/configuration.cpp#L80 I will close this issue.