fupdec / mediaChips

Manage your videos, add any metadata to them and play them.
https://mediachips.app
GNU General Public License v3.0
150 stars 20 forks source link

Number Meta sorted as String #147

Open pvtmann opened 1 year ago

pvtmann commented 1 year ago

This is probably be solved with the Database migration to SQLite also, but I'm going to post it just to be safe. I've created a number type simple Meta called "moral level". When sorting videos by this meta (or any other number meta) it will misplace the order. for instance it will sort 1 - 10 - 11 - 2 - 21 - 22 - 23 - 3 - 4 - 5 - 6 - 7. It can be prevented by adding left zeros as 01 - 02 - 03 - 04 - 10 -11 -12 - 13, but it requires to predict how far the count will go to keep the right format. In the example I'm filtering "0", to display fewer videos, and the Meta is the little Church Icon, and also, I've mixed both number with left zeros, to show their difference. It really seems that it sorts as String since 2 and 3 are placed after 10, 11, 12. Since JSON is natively text, and SQLite differs Text and numbers, it will probably be already solved.

image image