Updates for yggdrasil

This commit is contained in:
2025-04-15 13:58:49 -05:00
parent a82bd54091
commit 7962727fb3
10 changed files with 77 additions and 99 deletions

View File

@@ -1,10 +1,10 @@
#!/bin/bash
baseDir="/srv/yggdrasil/Videos/Shows"
baseDir="/home/yggdrasil/Videos/Shows"
# Helptext
function usage() {
echo Sort files from /srv/yggdrasil/new_acquisition into appropriate show directories.
echo Sort files from /home/yggdrasil/new_acquisition into appropriate show directories.
echo
echo Usage: $0 '[ -h ] [ -f fileToUse ] [ -c ] [ -n ] [ -q ] [ -v ]'
echo ' -c: Create sample sort file'
@@ -21,7 +21,7 @@ function HandleFile() {
file="$1"
# Sort out file metadata
dirtyshowname="$(echo "$file" | sed 's/.[Ss][0-9].[Ee][0-9].*$//')"
showname="$(ls -1 "$baseDir" | grep -iE "$dirtyshowname")"
showname="$(ls -1 "$baseDir" | grep -E -i "$dirtyshowname")"
epinfo="$(echo "$file" | sed "s/^${dirtyshowname}.//" | head -c 6)"
season="$(echo "$epinfo" | head -c 3 | tail -c 2)"
episode="$(echo -n "$epinfo" | tail -c 2)"
@@ -57,7 +57,7 @@ while getopts 'b:cf:hnqv' OPTION; do
esac
done
cd /srv/yggdrasil/new_acquisition
cd /home/yggdrasil/new_acquisition
echo INFO Unlocking filestore
if [ `whoami` != "root" ]; then yggdrasil-unlock; fi