I was wondering if there is a good way via OSMC or Kodi (or Linux) to grab a list of all the media-files in my library.
I know how to just list them to a text-file but that gives a list with subfolders etc. and is really hard to read.
Perfect scenario would be just the basic list like you can see in the movie/browsing with “list” chosen, then you get the right name for the movies and only 1-line per movie.
The title from the scraper and not the actual filename.
So this is to be used for multiple purposes, one is to easy search titles offline, another is like a backup incase a diskcrash so i know what content to remake.
I’m unsure but I think sqlite3 is installed by default, else you have to install it.
Run this commands and you get a list(only valid in kodi 18.x):
sqlite3 ./.kodi/userdata/Database/MyVideos116.db "select c00, c14, c16 from movie_view where 1;" > movielist.txt
This will give you a list, with LocalMovieName, Genre, OriginalTitle
If you want to decode the c00 or other magic in you libary here is a referens page: KodiDB and here is for the movie_view
PS. The “WHERE 1” is not needed, just added it to show you can put a where-conditions to filter the output. As “WHERE 1” is true for all the lines in the movie_view, you get em all. But you could "WHERE c14 LIKE ‘war’. You would only get a list where genre contains war.
This could also be done with the texture cache maintenance utility, which is also useful for broader purposes. The use case in question is outlined in the following thread…
Do note that this was posted with an earlier version of Kodi and I assume the script so you may have to slightly tweak. His first example cuts off a couple character’s (that is the only one I tested) so you will have to edit the command but it works.
osmc@kodicave:~$ ./texturecache.py j movies | grep '"title":' | cut -d: -f2- | awk '{print substr($0,3,length($0)-3)}'
*batteries not included
\u00a1Three Amigos!
2 Lava 2 Lantula!
10,000 Saints
12 Years a Slave
28 Days Later
28 Weeks Later
45 Years
1922
A Beautiful Day in the Neighborhood
A Boy and His Dog
This list continued for the rest of my movies. The oddity above is the only one I noticed on quick glance. This is probably minor as movie titles with an upside down exclamation are not common.
This works pretty good, the only downside is that they end up not in alphabetical order. But a copy paste into excel makes it easy to sort alphabetically. Thanks.
I’ve been fiddling with JOAKIM_S’s SQL command and it works just fine.
I’m familiar with SQL from prior work with MySQL (now MariaDB) on my Pi’s and before that with MS Access. However, the where clause construct “Where 1” is new to me and I have not (yet) found it in any on-line documentation. Can someone enlighten me or point me to a reference? Thanks…RDK
To be honest, i just compiled some sqlite statement from a page, but the only link i can find now, is related to DELETE. I guess i was unsure about if ALL worked. This was before i got into SQLite3, and started to look at what limitations/functions that was pure sql, and which where missing or altered. So i saw a site where ALL was written as “WHERE 1”. So i just made my own line, which used “Where 1” instead of ALL.
Put the where clause there to show anyone that you could "filter " some, for those that wanted to experiment.