This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Why Amarok has restriction on length of a filename?

Tags: None
(comma "," separated)
User avatar
Fireal
Registered Member
Posts
3
Karma
0
OS
Why Amarok has restriction on length of a filename in collection?

Example

This file play normally:
/home/fireal/public/music/collection/FLAC/Various Artists/Various Artists--A State Of Trance 2009 (Mixed by Armin van Buuren) - Disc 1 - On The Beach--2009--lossless FLAC tracks/A State Of Trance 2009 (Mixed by Armin van Buuren) - Disc 1 - On The Beach--03--M6--Paradise Lost.flac (280 - 37 = 243 symbols)

But this file displayed in collection, but not playable and not tagable throw collection:
/home/fireal/public/music/collection/FLAC/Various Artists/Various Artists--A State Of Trance 2009 (Mixed by Armin van Buuren) - Disc 1 - On The Beach--2009--lossless FLAC tracks/A State Of Trance 2009 (Mixed by Armin van Buuren) - Disc 1 - On The Beach--01--John O'Callaghan featuring Lo - Fi Sugar--Never Fade Away (Andy Duguid Mix) - On The Beach (Intro Edit).flac (366 - 37 = 329 symbols)
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS
Hm, the restriction, if there indeed is one, is more likely in MySQL. But you didn't tell what exact Amarok version you are talking about...


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
User avatar
Fireal
Registered Member
Posts
3
Karma
0
OS
Mamarok wrote:Hm, the restriction, if there indeed is one, is more likely in MySQL. But you didn't tell what exact Amarok version you are talking about...

media-sound/amarok-2.2.2-r1 from stable Gentoo branch.

Some interesting moments:
Code: Select all
black collection # cat SqlStorage.h
.....
class AMAROK_EXPORT SqlStorage
{
public:
    SqlStorage() {}
    virtual ~SqlStorage() {}
.....
    /**
        use this type for auto incrementing integer primary keys.
    */
    virtual QString idType() const = 0;

    virtual QString textColumnType( int length = 255 ) const = 0;
    virtual QString exactTextColumnType( int length = 1000 ) const = 0;
    //the below value may have to be decreased even more for different indexes; only time will tell
    virtual QString exactIndexableTextColumnType( int length = 324 ) const = 0;
    virtual QString longTextColumnType() const = 0;
    virtual QString randomFunc() const = 0;

};

#endif

black collection #
jefferai
Moderator
Posts
52
Karma
0
The restriction is there because of database indexing restrictions. It's not going to change, sorry.
User avatar
Fireal
Registered Member
Posts
3
Karma
0
OS
jefferai wrote:The restriction is there because of database indexing restrictions. It's not going to change, sorry.

Restriction is there because of database indexing restrictions, but it setuped in sourcecode of Amarok.
Here two files:
Code: Select all
black ~ # find ./tmp/amarok-2.2.2/src/ -name "Sql*.h"
./tmp/amarok-2.2.2/src/collection/SqlStorage.h
...
./tmp/amarok-2.2.2/src/collection/sqlcollection/SqlCollection.h
...
black ~ #

In it direct set length of indexes:
Code: Select all
black ~ # cat tmp/amarok-2.2.2/src/collection/SqlStorage.h
...
class AMAROK_EXPORT SqlStorage
{
public:
...
    virtual QString exactIndexableTextColumnType( int length = 324 ) const = 0;
...
black ~ #

Having increased number, I have received desirable result. Where it is possible to ask developers that they have included changes in official release?
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS
The developer responsible for this code, jefferai, already told you this is not going to be implemented. Sorry.


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
jefferai
Moderator
Posts
52
Karma
0
Fireal wrote:Restriction is there because of database indexing restrictions, but it setuped in sourcecode of Amarok.


Well, yes. The restrictions are in the source code so that the indexes fit/work.


Bookmarks



Who is online

Registered users: Bing [Bot], gfielding, Google [Bot], markhm, Sogou [Bot], Yahoo [Bot]