Is there a way to grab a nice list of all my media?

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.

what info would you like to have in that one line, if you can chose from kodi libary?

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.

3 Likes

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…

https://forum.kodi.tv/showthread.php?tid=166316

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.

This commans says I dont have the “texturecache.py”.

sqlite3 ./.kodi/userdata/Database/MyVideos116.db "select c00, c14, c16 from movie_view where 1 order by c00;" > movielist.txt

Nice, which command should I use for tv-shows, I see there are more then 1 to choose from.

You need to install it

wget https://raw.github.com/MilhouseVH/texturecache.py/master/texturecache.py chmod +x ./texturecache.py

1 Like

sqlite3 ./.kodi/userdata/Database/MyVideos116.db "select c00, c14, c16 from tvshow_view where 1 order by c00;"

Thanks alot.

You know what, I am more than happy with how these lists turned out, it will serve the purpuse well and is very easy to update.

I used to just do it directly from the harddrives but got all the subfolders etc. and also have to do it on so many drives so this is a real step up.

Again thanks!!

1 Like

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

I was wondering the same. It doesn’t look like it’s needed @joakim_s.

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.

OK, understood. afaik, a WHERE clause is always optional.

OK, Question answered. Thanks…RDK

Next time’ i’ll try to explain “uneeded” bits. :rofl:

2 Likes

Added a PS to the post to explain the thought about “WHERE 1”