diff options
author | breadcat | 2020-06-19 12:23:15 +0100 |
---|---|---|
committer | breadcat | 2020-06-19 12:23:15 +0100 |
commit | 70bb5d5a801428b0fb390abf79f19ffcf5e29c67 (patch) | |
tree | b9fd7990156bd58bc38d58f91829c05933215102 /content/posts/kodi-watched-list-export.md | |
parent | 0f9a31348079c0a061bcc194912e75cc1c07bc1f (diff) | |
download | blog.minskio.co.uk-70bb5d5a801428b0fb390abf79f19ffcf5e29c67.tar.gz blog.minskio.co.uk-70bb5d5a801428b0fb390abf79f19ffcf5e29c67.tar.bz2 blog.minskio.co.uk-70bb5d5a801428b0fb390abf79f19ffcf5e29c67.zip |
Simple migration of existing posts to hugo format
Diffstat (limited to 'content/posts/kodi-watched-list-export.md')
-rw-r--r-- | content/posts/kodi-watched-list-export.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/content/posts/kodi-watched-list-export.md b/content/posts/kodi-watched-list-export.md new file mode 100644 index 0000000..468c162 --- /dev/null +++ b/content/posts/kodi-watched-list-export.md @@ -0,0 +1,28 @@ +--- +title: "Exporting Kodi Watched Status to Markdown" +date: 2019-01-31T10:25:00 +tags: [ "guides", "kodi", "linux", "media", "movies", "servers", "snippets", "software" ] +--- + +As I've outlined in [this page](/archive/movies/) I'd prefer to save space on my server and delete movies once I've seen them but also keep a log so I don't need to remember everything. + +Step in the Kodi plugin [WatchedList](https://kodi.wiki/view/Add-on:WatchedList) which will happily export your status to a SQLite database that can be worked with as follows: +``` +if [ -f "movies.csv" ]; then rm movies.csv; fi +sqlite3 -noheader -csv watchedlist.db "select title from movie_watched;" > movies.csv +sed -i -e 's|\"||g' -e 's|^|* |g' movies.csv +sort -k 2 < movies.csv > movies.md +rm movies.csv +``` + +One thing you may notice, is movies being released in year '65535'. This is caused by your Kodi library itself and can be sorted by refreshing the title to grab new (and hopefully correct) metadata. + +You can also run the below to get a list of TV shows that have watched episodes. I'm unable to find an efficient way of getting completely watched TV shows, but the below will get you halfway there: +``` +sqlite3 -noheader -csv watchedlist.db "select * from tvshows;" > tv_shows_index.csv +watched_id=$(sqlite3 -noheader watchedlist.db "select idShow from episode_watched;" | uniq) +for i in $watched_id; do grep $i tv_shows_index.csv | cut -f2 -d, >> tv_shows.csv; done +sed -i -e 's|\"||g' -e 's|^|* |g' tv_shows.csv +sort -k 2 < tv_shows.csv > tv_shows.md +rm tv_shows.csv tv_shows_index.csv +```
\ No newline at end of file |