AIMP Forum

AIMP for Android => Ошибки и замечания / Bugs => Обработано / Processed => Topic started by: cu1tur4l on May 20, 2024, 20:56:19

Title: [x] [1414] "Top 100" section in "my library" displays same song multiple times
Post by: cu1tur4l on May 20, 2024, 20:56:19
Hello!

Firstly, sorry If someone already asked about this, I don't speak russian, I tried searching for "дубликат", "топ 100", "дублированный", "дубликаты", and translate the results from 2022-2024 but I did not found something that could help me. Only thing that (maybe) could help me is this https://www.aimp.ru/forum/index.php?topic=72579 but I'm not sure if "Stored in the music library database" means that we can change it how we want to.

This is probably my fault, and I probably know why it happened, but I'm curious if I can fix it somehow.
Yesterday when I was adding new songs to my phone, I went to update the "My library" and noticed new(for me) menu; "top 100" entered it, and noticed that first two songs are the same. They have different playcounts (one is 191 and one is 166) but they are the same, the only difference is the album they are from.
The reason for this is simple: This song was a single from a upcoming album. When it got released, I uploaded it to my phone and because it was a single, the tags did not have the album name, instead the album name was a song title. So now first and second place is occupied by the same song, when I click "file information" it leads me to the same song, with the same path. The album name is (now) also the same (because when I got the whole album, I changed all tags to display correct album), there are no differences, just on the top 100 list, they are "duplicated".

Now, since this is "my fault", the only thing I would like to know is there a way to  delete nvm, I just noticed the trash icon that is always in the same spot xd add the 166 to the 191 one before deleting one of them? Because I have 3 more examples like that in my top 100, so it would be convenient if I could :) But I don't know if is possible since - from my knowledge - we cannot change playcount numbers on PC :/
Wouldn't it be possible to make it so that if two files have the same path, their playcount is adds up and they become one?

I know this is tremendously "first world problem", but yeah, I'm here anyway.

Anyway, thank you so much for still working and maintaining AIMP, this is truly the best music player!
Title: Re: "Top 100" section in "my library" displays same song multiple times
Post by: Artem on May 20, 2024, 20:57:59
Yesterday when I was adding new songs to my phone, I went to update the "My library" and noticed new(for me) menu; "top 100" entered it, and noticed that first two songs are the same. They have different playcounts (one is 191 and one is 166) but they are the same, the only difference is the album they are from.

What about file names? Are these equals?
Title: Re: "Top 100" section in "my library" displays same song multiple times
Post by: cu1tur4l on May 20, 2024, 21:32:19
Yes. That's what I meant by saying "file path is the same", sorry I wasn't clear enough.

Edit.
The 166 one is *literally* the same. When I bought the album I only uploaded new songs. And changed the 191's album tag from song name to, well, album name.
Title: Re: "Top 100" section in "my library" displays same song multiple times
Post by: cu1tur4l on May 20, 2024, 21:49:50
I don't know if this is relevant, but bot of them have the same "added date", but they have different "last play date".
Title: Re: "Top 100" section in "my library" displays same song multiple times
Post by: Artem on May 20, 2024, 22:27:41
Can you share to me your DB of music library?
Title: Re: "Top 100" section in "my library" displays same song multiple times
Post by: cu1tur4l on May 20, 2024, 22:49:51
Sure i can, but unfortunately, not now. I'm just starting my night shift. Please tell me how to do it, and I will, tomorrow morning. Or maybe in 4h, not sure.
Title: Re: "Top 100" section in "my library" displays same song multiple times
Post by: cu1tur4l on May 21, 2024, 17:59:01
Well, it's not necessary morning...   :-[ But I would be happy to do it, but I still don't know how. I quickly looked at all settings and did not found "export db" or anything like that.
Title: Re: "Top 100" section in "my library" displays same song multiple times
Post by: Artem on May 22, 2024, 07:41:56
But I would be happy to do it, but I still don't know how. I quickly looked at all settings and did not found "export db" or anything like that.

Settings \ Export settings
Title: Re: "Top 100" section in "my library" displays same song multiple times
Post by: cu1tur4l on May 22, 2024, 21:39:24
Sorry it took so long. Just the "databases" folder? Can I "safely" share it here, or should I pm you?
Title: Re: "Top 100" section in "my library" displays same song multiple times
Post by: Artem on May 23, 2024, 09:32:39
Sorry it took so long. Just the "databases" folder?

Yep, you can send just "databases" folder

Can I "safely" share it here, or should I pm you?

As you want.
Title: Re: "Top 100" section in "my library" displays same song multiple times
Post by: cu1tur4l on May 23, 2024, 19:02:28
Then here it is
Title: Re: "Top 100" section in "my library" displays same song multiple times
Post by: Artem on May 24, 2024, 15:50:41
Then here it is

Thanks
Title: Re: "Top 100" section in "my library" displays same song multiple times
Post by: Artem on May 24, 2024, 16:26:06
I've found a root of issue.
(https://www.aimp.ru/forum/index.php?action=dlattach;topic=72854.0;attach=71521)

By default, database compares the filenames in case-sensitive manner. So, what why one file was added to database twice.

If you want, I can remove all duplicates from your database manually and send edited database back to you?

P.S. The issue will be fixed in next update, but already added duplicates will not be deleted from database.
Title: Re: [x] [1414] "Top 100" section in "my library" displays same song multiple times
Post by: cu1tur4l on May 24, 2024, 18:53:33
Ah... To be honest, I even quickly glanced over the file before sending it to you, searching for "OPIUM!", but did not notice this. Too quick of a glance, I guess :p

Is it possible for you to add the plays from the old one to the new one? If so, could you do it for me?

If you already found all the duplicates, or if it is 2 minute job for you, then you can delete them for me. But if not, there is no need - if I can delete them from top 100 section, I will do it myself to not trouble you anymore.

Thank you for your help :)
Title: Re: [x] [1414] "Top 100" section in "my library" displays same song multiple times
Post by: Artem on May 24, 2024, 22:27:40
Nightly build with fix:
https://disk.yandex.ru/d/ICgpY-fzHBNXlg

Updated database:
https://disk.yandex.ru/d/cSmZALZ73KiKGA

local://primary/Music/Płyty/Chivas - Deathcores/Chivas - Death note.flac
local://primary/Music/Płyty/Chivas - Deathcores/Chivas - NIENAWIDZĘ WARSZAWY!.flac
local://primary/Music/Płyty/Chivas - Deathcores/Chivas - nóż motylkowy.flac
local://primary/Music/Płyty/Chivas - Deathcores/Chivas - OPIUM!.flac
local://primary/Music/̶F̶u̶n̶k̶k̶/OKI - Amerykańskie Teledyski.flac
local://primary/Music/̶F̶u̶n̶k̶k̶/OKI - Przypadkiem.flac
local://primary/Music/̶F̶u̶n̶k̶k̶/OKI - Transparentny.flac
Title: Re: [x] [1414] "Top 100" section in "my library" displays same song multiple times
Post by: cu1tur4l on May 27, 2024, 01:02:32
Hey again, sorry for replying so long after we "closed" the topic.

I tried it quickly after you uploaded the files, it didn't work, but I didn't have time to sort it out till now.
The text below is the old post, that is not important anymore.
I have two (the second one is extracted outside this "read more" because it is still important) questions:
First one is the app checking in any way the, lets say, integrity of the files you try to import?
Because of my bad habit of deleting files that "are not important" to me, right after I uploaded the database you asked for, I deleted the whole settings export, without thinking that it could be needed later. And now when I exported my settings again, replaced the database file, Aimp tells me that they have incorrect structure (direct translation, not sure if the error message is the same in other languages) and it prevents me from uploading it.

Not important, but maybe it shouldn't be that way:
I'm asking does it check about integrity or something like that, because when I changed the file name of the exported settings, the error message was the same (without the "ERROR:" at the beginning of it) but there was no "WARNING! All settings will be ERASED! Continue?" pop up message, that, heh, pops up when the file name is not changed. So if the file name is important, maybe inside the file is, lets say, the date of the export, and it checks it with the file name? I thought that my issue was the .rar extension, but I .zip'ed it and it still spits out the error message.


And finally, if it does check for integrity, and you did add the play counts, I would be very glad if I could send you the exported settings again, for you to fix them :/
I am very sorry if this is my fault, and I'm again increasing your workload. I shouldn't delete the export, but how could I know? Sorry again.

Right after typing all of this, literally, like 5 minutes after, I found the original export... I don't know how I didn't see it earlier, anyway it does not work.

Original export does not work because I unzipped it and rezipping it* causes the same error (incorrect file structure)
*I'm using WinRar and just doing RMB->Add to archive->archive format: .zip
New export (from today) does work, however the app re-launched, then crashed, and now when I enter "my library" it shows that all of my files are new, added today, no playcounts.
I'm including the error log, not sure if it will be helpful, I'm "merging" two different exports, and that's probably why it crashes, but it will not hurt to upload it, I think.

Question: Did you manage to add the play counts of the deleted songs? Or did you just erased duplicates? Because if you only erased duplicates, I will erase them manually from the app, since now - because of you - I know all the duplicates.
Title: Re: [x] [1414] "Top 100" section in "my library" displays same song multiple times
Post by: Artem on May 27, 2024, 08:10:48
did you just erased duplicates?

I have merged play counts to original files.

Original export does not work because I unzipped it and rezipping it* causes the same error (incorrect file structure)

Code: [Select]
SQLiteDatabaseCorruptException: database disk image is malformed (code 11 SQLITE_CORRUPT)

Title: Re: [x] [1414] "Top 100" section in "my library" displays same song multiple times
Post by: cu1tur4l on May 27, 2024, 16:34:16

Code: [Select]
SQLiteDatabaseCorruptException: database disk image is malformed (code 11 SQLITE_CORRUPT)

I'm not sure if you mean "the reason is clear and simple, use your brain" (not trying to sound mean) by quoting the error log, if so, I already tried googling this part, but found no help, since the posts are usually dev related.
The only thing I found that might be helpful (but it wasn't (for me)) is this: https://sqlite.org/howtocorrupt.html
Title: Re: [x] [1414] "Top 100" section in "my library" displays same song multiple times
Post by: Artem on May 27, 2024, 17:17:10
Do you unpack the database before adding it to backup archive?
Title: Re: [x] [1414] "Top 100" section in "my library" displays same song multiple times
Post by: cu1tur4l on May 27, 2024, 17:47:21
Tried it both ways if I remember correctly. Cannot test it right now since I cannot not unpack it on through my phone file manager. I can test it around 10:30.
Title: Re: [x] [1414] "Top 100" section in "my library" displays same song multiple times
Post by: Artem on May 27, 2024, 21:04:08
I've checked the database file, its valid.
Title: Re: [x] [1414] "Top 100" section in "my library" displays same song multiple times
Post by: cu1tur4l on May 28, 2024, 00:14:29
I re-checked in all ways:
Unpacking both things and repacking them
Unpacking only one of the files
Not unpacking anything

With the export from today - since I only have unzipped export from 22.05 - and your DB file, the app still crashes, with the same "database disk image is malformed (code 11 (...))" error. I also checked unzipped 22.05 in possible ways, still "archive has incorrect file structure" toast error.

If you would be so kind - after all that time you have wasted on me - I will just upload whole settings export, so you can edit it internally without me messing up anything.
Title: Re: [x] [1414] "Top 100" section in "my library" displays same song multiple times
Post by: Artem on May 28, 2024, 15:02:46
Done
Title: Re: [x] [1414] "Top 100" section in "my library" displays same song multiple times
Post by: cu1tur4l on May 28, 2024, 19:17:26
Aaand it is working, thank you so much.