Wed Oct 19, 2022 3:29 am by eewiz
O.K. now I have the answer(s).
Remember that this is Serviio 2.2.1 running in a jail on a Truenas server.
First, Serviio does not index Windows shortcuts.
I don't know if Serviio will index shortcuts in a pure Windows environment. I can't test that anymore.
Second, Serviio does not index MP3s encoded with LAME3.99r.
Third, Serviio does not index MP3s with Truenas attributes -rwxrwx---+ nor does it index MP3s in any folder with attributes drwxrwx---+.
Any time I re-encode an MP3 to something other than LAME3.99r, Truenas applies the attributes -rwxrwx---+ to the new MP3, making the file invisible to Serviio.
Any time I create a new folder to hold MP3s, Truenas applies the attributes drwxrwx---+ to the new directory, making all files in that directory invisible to Serviio.
I assume that this Truenas behavior could be changed but, not by me. I have no clue how to do that and have no time to waste finding out how.
To fix the first issue, I do a windows search for *.lnk to find any shortcuts, then I replace them with actual copies of the MP3s they pointed to, to eliminate the shortcuts.
Then, to fix the second issue, I wrote this batch program to automatically find and re-encode any MP3 that was originally encoded with LAME3.99r.
Here's the contents of the batch file:
@echo off
if not "%1"=="am_admin" (
powershell -Command "Start-Process -Verb RunAs -FilePath '%0' -ArgumentList 'am_admin'"
exit /b
)
cd /D %~dp0
echo.
echo FINDING FILES
findstr /s /M "LAME3.99r" * > Files.txt
pause
echo PROCESSING FILES
for /F "tokens=*" %%i in (files.txt) do (
if not "%%~ni"=="Fix_LAME" (
B:\Tools\ffmpeg\x64\ffmpeg.exe -y -stats -i "%%i" -vn -ar 44100 -ac 2 -b:a 192k -map_metadata:g -1 -threads 12 "%%~fni.mp3"
del "%%i"
ren "%%i.mp3" "%%~ni.mp3"
echo.
)
)
pause
The batch program above is not commented. Those that do not understand it probably should not use it.
To fix the third issue I keep a console window open on the Truenas server so I can do "chmod -R 777 FolderName" on the top level directory that I've fixed the first or second issues within.
Here are the steps I did to fix the issues.
To start with, I removed all music folders from Serviio. That took something like a day's worth of time.
First, I fix any shortcut issues in the next music folder that needs to be fixed.
Then I copy the batch file to that top-level folder and run it.
At the first pause I examine the Files.txt file to see if there is any re-encoding work to be done as well as a sanity check on the Files.txt contents.
Then I hit enter to allow the batch program to proceed to re-encode all the files in Files.txt file with FFMPEG.
FFMPEG is done when the batch program hits the second pause.
Then I go to my Truenas console and do a "chmod -R 777 FolderName" to set all directory and file attributes to rwxrwxrwx+ from that top-level directory.
Then I add the music folder back into Serviio and it indexes every MP3 without a hitch.
This has cost me three whole days of valuable time that I did not want to spend.
I hope this information will help others that find themselves in a similar situation.
All for now