Plugins - LathDevers/RasPi-OMV-Setup GitHub Wiki

Skip Intro

GitHub Repository

  1. On Jellyfin interface (192.168.x.x:8096) go to hamburger menu and Dashboard

  2. Go to Plugins at the bottom, then Repositories tab at the top

  3. Click the + sign at Repositories

    • Repository Name: anything, e. g. Skip Intro
    • Repository URL: https://raw.githubusercontent.com/ConfusedPolarBear/intro-skipper/master/manifest.json
    • click Save
  4. Under Catalog click the newly added Intro Skipper plugin and click Install (select the newest version)

  5. Reboot the Pi (or if you can, just Jellyfin)

    sudo reboot
    
  6. Then in the menu at the bottom, click Scheduled Tasks and click the play button at Detect Introductions task

    • this may take a while, depending on the size of your media library (in my case, it was a couple of hours)

Language flags overlay on posters

Credits to ProductRockstars who posted the original code on Reddit.

You should place the bash file somewhere on your server and execute it once. It runs in an infinite loop each day once.

#!/bin/bash
MOV='/mnt_data/media/'
OVE='/mnt_data/media/'
while true; do
	cd "$MOV"
	for dir in */; do
		cd "$MOV$dir"
		pwd

		flink=$(readlink -f poster.jpg)
		creatortool=$(exiftool -f -s3 -"creatortool" "$flink")

		if [ "${creatortool}" != "993" ]; then
			mlink=$(readlink -f *.mkv)
			langs=$(ffprobe "$mlink" -show_entries stream=index:stream_tags=language -select_streams a -v 0 -of json=c=1 | jq --raw-output '.streams[].tags.language')

			GER='ger'
			DUT='dut'
			ENG='eng'
			HUN='hun'

			case $langs in

			*"$ENG"*)
				widthposter=$(exiftool -f -s3 -"ImageWidth" "$flink")
				convert "$OVE"dut_overlay.png -resize "$widthposter" "$OVE"dut_overlay_tmp.png
				convert "$flink" "$OVE"dut_overlay_tmp.png -flatten "$flink"
				chmod +644 "$flink"
				chown nobody "$flink"
				exiftool -creatortool="993" -overwrite_original "$flink"
				;;

			*"$GER"*)
				widthposter=$(exiftool -f -s3 -"ImageWidth" "$flink")
				convert "$OVE"ger_overlay.png -resize "$widthposter" "$OVE"ger_overlay_tmp.png
				convert "$flink" "$OVE"ger_overlay_tmp.png -flatten "$flink"
				chmod +644 "$flink"
				chown nobody "$flink"
				exiftool -creatortool="993" -overwrite_original "$flink"
				;;
			esac
		fi
	done
	sleep 90000
done

You will probably need to install the following packages (you can use sudo apt install)

  • ffmpeg (for ffprob)
  • libimage-exiftool-perl (for exiftool)
  • imagemagick (for convert)
    • this also installed some additional packages: hicolor-icon-theme imagemagick-6-common imagemagick-6.q16 libde265-0 libheif1 liblcms2-2 liblqr-1-0 libltdl7 libmagickcore-6.q16-6 libmagickwand-6.q16-6 `libwebpdemux2

The script requires you to have all your movies inside separate folders with poster JPEGs. The script will edit those JPEGs, this is a permanent change! (Possible code change could be, that it renames the original file and creates a new file with the flag overlay under the name poster.jpg.) Also, it is not ready to deal with multi-lingual files. It'll just use the first language it reads. For these reasons, I myself ditched it. But maybe in the future, if I'll have more time, I edit the script and possibly my library for this functionality.

I also not yet fully understand, how it places the flag overlay. On first try, it put a huge flag on the top half of the poster. Possibly, the flag and poster image files must have the correct size?