Compare commits

..

No commits in common. "master" and "4.0.8" have entirely different histories.

37 changed files with 202 additions and 658 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -51,7 +51,6 @@ dsmtextnotify="on"
MessageTo="admin"
dsmbeepnotify="on"
LOGlevel="1"
LOGmax=""
reindex=1
#--------------------------------------------------------------------

View file

@ -2,11 +2,8 @@
".url": {
"SYNO.SDS.synOTR.Application": {
"type": "legacy",
"allUsers": false,
"allUsers": true,
"allowMultiInstance": false,
"grantPrivilege": "all",
"advanceGrantPrivilege" : true,
"configablePrivilege" : true,
"title": "synOTR",
"desc": "",
"icon": "images/synOTR_{0}.png",

View file

@ -28,9 +28,7 @@ if [[ "$page" == "edit-save" ]]; then
"$set_var" "$dir/app/etc/Konfiguration.txt" "dsmtextnotify" "$dsmtextnotify"
"$set_var" "$dir/app/etc/Konfiguration.txt" "MessageTo" "$MessageTo"
"$set_var" "$dir/app/etc/Konfiguration.txt" "dsmbeepnotify" "$dsmbeepnotify"
"$set_var" "$dir/app/etc/Konfiguration.txt" "PBTOKEN" "$PBTOKEN"
"$set_var" "$dir/app/etc/Konfiguration.txt" "LOGlevel" "$LOGlevel"
"$set_var" "$dir/app/etc/Konfiguration.txt" "LOGmax" "$LOGmax"
"$set_var" "$dir/app/etc/Konfiguration.txt" "endgueltigloeschen" "$endgueltigloeschen"
"$set_var" "$dir/app/etc/Konfiguration.txt" "reindex" "$reindex"
"$set_var" "$dir/app/etc/Konfiguration.txt" "cutlistat_ID" "$cutlistat_ID"
@ -88,9 +86,7 @@ if [[ "$page" == "edit-import-query" ]] || [[ "$page" == "edit-import" ]]; then
"$set_var" "$dir/app/etc/Konfiguration.txt" "dsmtextnotify" "$dsmtextnotify"
"$set_var" "$dir/app/etc/Konfiguration.txt" "MessageTo" "$MessageTo"
"$set_var" "$dir/app/etc/Konfiguration.txt" "dsmbeepnotify" "$dsmbeepnotify"
"$set_var" "$dir/app/etc/Konfiguration.txt" "PBTOKEN" "$PBTOKEN"
"$set_var" "$dir/app/etc/Konfiguration.txt" "LOGlevel" "$LOGlevel"
"$set_var" "$dir/app/etc/Konfiguration.txt" "LOGmax" "$LOGmax"
"$set_var" "$dir/app/etc/Konfiguration.txt" "endgueltigloeschen" "$endgueltigloeschen"
"$set_var" "$dir/app/etc/Konfiguration.txt" "reindex" "$reindex"
"$set_var" "$dir/app/etc/Konfiguration.txt" "cutlistat_ID" "$cutlistat_ID"
@ -362,24 +358,24 @@ if [[ "$page" == "edit" ]]; then
# SMARTRENDERING
echo '
<p>
<label>Art zu Schneiden</label>
<label>Smartrendering</label>
<select name="SMARTRENDERING">'
if [[ "$SMARTRENDERING" == "off" ]]; then
echo '<option value="off" selected>Cut an Keyframes</option>'
echo '<option value="off" selected>aus</option>'
else
echo '<option value="off">Cut an Keyframes</option>'
echo '<option value="off">aus</option>'
fi
if [[ "$SMARTRENDERING" == "on" ]]; then
echo '<option value="on" selected>Smartrendering</option>'
echo '<option value="on" selected>ein</option>'
else
echo '<option value="on">Smartrendering</option>'
echo '<option value="on">ein</option>'
fi
echo '
</select>
<a class="helpbox" href="#HELP">
<img src="images/icon_information_mini@geimist.svg" height="25" width="25"/>
<span>Für das Schneiden an Keyframes wird avisplit/avimerge aus Transcode verwendet. Diese Art geht sehr schnell (fast wie das Kopieren der Dateien auf der Festplatte). Der Nachteil ist, dass die Schnittübergänge um mehrere Sekunden ungenau sind und nur avi-Quelldateien scheidbar sind.
<br><br>Smartrendering: Für das framegenaue Schneiden wird das Programm avcut verwendet. Avcut schneidet im Gegensatz zu avisplit framegenau, allerdings ergeben sich daraus erhöhte Anforderungen an die CPU und RAM (min. installiert: 1GB für HD-Aufnahmen und 500MB für HQ-Aufnahmen). Framegenaue Schnitte sind zeitintensiv.
<br><br>Für das framegenaue Schneiden wird das Programm avcut verwendet. Avcut schneidet im Gegensatz zu avisplit framegenau, allerdings ergeben sich daraus erhöhte Anforderungen an die CPU und RAM (min. installiert: 1GB für HD-Aufnahmen und 500MB für HQ-Aufnahmen). Framegenaue Schnitte sind zeitintensiv.
<br><br>ACHTUNG: mit avcut geschnittene Filme werden derzeit sehr asynchron. Die Option der Konvertierung zu MP4 löst das Problem!</span></a>
</p>'
# WaitOfCutlist
@ -470,7 +466,7 @@ if [[ "$page" == "edit" ]]; then
echo '
<a class="helpbox" href="#HELP">
<img src="images/icon_information_mini@geimist.svg" height="25" width="25"/>
<span>Frameversatz, um Cuts manuell zu justieren (positive Werte verschieben jeden Cut nach hinten, negative nach vorn)<br><br>=> dieser Wert verschiebt den <b>Beginn</b> der gewünschten Filmteile beim framegenauen Schneiden<br><br>(greift nur in Verbindung mit Smartrendering)</span></a>
<span>Frameversatz, um Cuts manuell zu justieren (positive Werte verschieben jeden Cut nach hinten, negative nach vorn)<br><br>=> dieser Wert verschiebt den <b>Beginn</b> der gewünschten Filmteile beim framegenauen Schneiden</span></a>
</p>'
# FrameversatzEndeCut
echo '
@ -484,7 +480,7 @@ if [[ "$page" == "edit" ]]; then
echo '
<a class="helpbox" href="#HELP">
<img src="images/icon_information_mini@geimist.svg" height="25" width="25"/>
<span>Frameversatz, um Cuts manuell zu justieren (positive Werte verschieben jeden Cut nach hinten, negative nach vorn)<br><br>=> dieser Wert verschiebt das <b>Ende</b> der gewünschten Filmteile beim framegenauen Schneiden<br><br>(greift nur in Verbindung mit Smartrendering)</span></a>
<span>Frameversatz, um Cuts manuell zu justieren (positive Werte verschieben jeden Cut nach hinten, negative nach vorn)<br><br>=> dieser Wert verschiebt das <b>Ende</b> der gewünschten Filmteile beim framegenauen Schneiden</span></a>
</p>
</fieldset>
</p>
@ -611,14 +607,14 @@ if [[ "$page" == "edit" ]]; then
</p>
</details>'
# -> Abschnitt .avi's in native MP4's umwandeln
# -> Abschnitt .avi's in native MP4's (MAC OS tauglich) umwandeln
echo '<fieldset>
<hr style="border-style: dashed; size: 1px;">
<br />
<details><p>
<summary>
<span class="detailsitem">AVI-Filme in native MP4-Filme umwandeln</span>
<span class="detailsitem">AVI-Filme in native MP4-Filme (macOS tauglich) umwandeln</span>
</summary></p>
<p>'
@ -747,22 +743,6 @@ if [[ "$page" == "edit" ]]; then
<br>Auf diese Art kann man sich in Verbindung mit dem Paket "Notification Forwarder" über synOTR-Ereignisse z.B. über einen Pushdienst benachrichtigen lassen.
<br>Bleibt der Wert leer, so wird die Gruppe "administrators" benachrichtigt.
</span></a></p>'
# PushBullet-Token
echo '
<p>
<label>PushBullet-Token</label>'
if [ -n "$PBTOKEN" ]; then
echo '<input type="text" name="PBTOKEN" value="'$PBTOKEN'" />'
else
echo '<input type="text" name="PBTOKEN" value="" />'
fi
echo '
<a class="helpbox" href="#HELP">
<img src="images/icon_information_mini@geimist.svg" height="25" width="25"/>
<span>Dein persönlicher PushBullet-Token.
<br>Benachrichtigungen werden an den entsprechenden Account gesendet.
<br>Bei Nichtgebrauch leer lassen.
</span></a></p>'
# dsmbeepnotify
echo '
<p>
@ -812,22 +792,6 @@ if [[ "$page" == "edit" ]]; then
<span>0 => es wird keine Log-Datei erstellt<br>1 => normales Log (standard)<br>2 => erweitertes Log
<br>Die Logs befinden sich im Dekodierverzeichnis/_LOGsynOTR/</span></a>
</p>'
# LOGmax
echo '
<p>
<label>max. Anzahl LOGfiles</label>'
if [ -n "$LOGmax" ]; then
echo '<input type="text" name="LOGmax" value="'$LOGmax'" />'
else
echo '<input type="text" name="LOGmax" value="" />'
fi
echo '
<a class="helpbox" href="#HELP">
<img src="images/icon_information_mini@geimist.svg" height="25" width="25"/>
<span>LOG-Files können automatisch gelöscht werden, indem hier die maximal gewünschte Anzahl angegeben wird.
<br>Sobald hier ein Wert vergeben wird, werden grundsätzlich alle leeren LOGs gelöscht.
<br>(Die Anzahl bezieht sich also nur auf LOGs mit Einträgen)
</span></a></p>'
# reindex
echo '
<p>

View file

@ -16,8 +16,7 @@ echo '
<li>Um synOTR regelmäßig laufen zu lassen (was sich empfiehlt), erstelle als
nächstes <br>einen automatisierten Programmaufruf.
<div class="tab"><br>
Dazu hast du 2 Möglichkeiten:<br>verwende den <a href="index.cgi?page=timer" style="'$synotrred';">Zeitplaner</a> für einen programmierten synOTR-Start.
<br><br>Hierbei ist zu beachten, dass der DSM-Sicherheitsbereater den Zusätzlichen Croneintrag (da für DSM unbekannt) bemängelt!</p><hr>
Dazu hast du 2 Möglichkeiten:<br>verwende den <a href="index.cgi?page=timer" style="'$synotrred';">Zeitplaner</a> für einen programmierten synOTR-Start.</p><hr>
<p>Oder, erstelle alternativ im Aufgabenplaner einen neuen Task mit diesem
Programmpfad<br>(zu empfehlen, sofern du kürzere Intervalle als "stündlich" benötigst):</p>
<p style="margin-left: 40px;"><code>/usr/syno/synoman/webman/3rdparty/synOTR/synOTR-start.sh</code></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View file

@ -1,5 +1,2 @@
s/Qüen/Queen/g
s/qüen/queen/g
s/Trü/True/g
s/trü/true/g
s/beqüm/bequem/g

View file

@ -44,9 +44,9 @@
an Daniel Dieth von otr-serien.de für das zur Verfügungstellen seiner Website und seine Unterstützung.
Bitte unterstützt die Seite <a href="http://www.otr-serien.de" rel="external">www.otr-serien.de</a>.
Über die Seite lässt es sich auch sehr einfach nach bestimmten
Episoden suchen. <s>Ihr habt eine ausgestrahlte Serienepisode, die dort
Episoden suchen. Ihr habt eine ausgestrahlte Serienepisode, die dort
nicht automatisch erkannt wurde? Dann gebt doch bei der betroffenen
Episode eine Rückmeldung ab.</s><br>
Episode eine Rückmeldung ab.<br>
<br>
<img class="imageStyle"
alt="LOGO_thetvdb.com"
@ -59,11 +59,11 @@
Bitte unterstützt diesen kostenlosen Service, indem ihr nach
Möglichkeit Informationen und Grafiken beitragt und ergänzt.<br>
<br>
<s>Sollten keine Serieninformationen zu einer Sendung gefunden worden
Sollten keine Serieninformationen zu einer Sendung gefunden worden
sein, so wird die Standardumbenennung verwendet und die Infos in
einer Datenbank gesichert. Werden entsprechende Informationen auf
otr-serien.de ergänzt, so wird nachträglich die Standardumbenennung
in die Serienumbenennung vorgenommen (Suchzeit derzeit 7 Tage).</s>
in die Serienumbenennung vorgenommen (Suchzeit derzeit 7 Tage).
</div>
</li>
<li><span style="color:#0086E5;font-weight:bold; ">Konvertieren

View file

@ -85,18 +85,24 @@ func_main_LastLog () {
# Dateistatus auslesen:
# ---------------------------------------------------------------------
# .otrkey-Files:
count_otrkey=$( ls -t "${OTRkeydir}" | egrep -o '.*.otrkey$' | wc -l ) # wie viele Dateien
count_otrkey=0
for i in $(find "$OTRkeydir" -maxdepth 1 -name "*.otrkey" -type f)
do
count_otrkey=$(( count_otrkey + 1 ))
done
# wait of cutlist:
count_waitofcutlist=$( expr $( ls -t "${DECODIR}" | egrep -o '.*.avi$' | wc -l ) + $( ls -t "${DECODIR}" | egrep -o '.*.mp4$' | wc -l ) ) # wie viele Dateien
count_waitofcutlist=0
for i in $(find "$DECODIR" -maxdepth 1 -name "*.avi" -o -name "*.mp4" -type f)
do
count_waitofcutlist=$(( count_waitofcutlist + 1 ))
done
# manueller synOTR-Start:
# ---------------------------------------------------------------------
if [[ "$page" == "status-run-synotr" ]]; then
echo '
<div class="Content_1Col_full">'
/usr/syno/synoman/webman/3rdparty/synOTR/synOTR-start.sh GUI
/usr/syno/synoman/webman/3rdparty/synOTR/synOTR-start.sh
func_main_LastLog
# echo $refreshtime
echo '<meta http-equiv="refresh" content="2; URL=index.cgi?page=status"></div>'

View file

@ -1,15 +1,6 @@
#!/bin/sh
# /usr/syno/synoman/webman/3rdparty/synOTR/synOTR-start.sh
# wechselt in synOTR-Verzeichnis und startet synOTR mit bzw. ohne LOG (je nach Konfiguration)
# wurde das Skript von der GUI aufgerufen (Aufruf mit Parameter "GUI" für )?
callFrom=$1
if [ -z $callFrom ] ; then
callFrom="shell"
else
callFrom="GUI"
fi
# Arbeitsverzeichnis auslesen und hineinwechseln:
APPDIR=$(cd $(dirname $0);pwd)
cd ${APPDIR}
@ -24,29 +15,20 @@
# echo "synOTR läuft bereits!"
# exit
# fi
synOTR_pid=$( /bin/pidof synOTR.sh )
synOTR_pid=`pidof synOTR.sh`
if [ ! -z "$synOTR_pid" ] ; then
if [ $callFrom = GUI ] ; then
echo '<p class="center"><span style="color: #BD0010;"><b>synOTR läuft bereits!</b><br>(Prozess-ID: '$synOTR_pid')</span></p>'
echo '<br /><p class="center"><button name="page" value="status-kill-synotr" style="color: #BD0010;">(Beenden erzwingen?)</button></p><br />'
else
echo "synOTR läuft bereits! (Prozess-ID: $synOTR_pid)"
fi
echo '<p class="center"><span style="color: #BD0010;"><b>synOTR läuft bereits!</b><br>(Prozess-ID: '$synOTR_pid')</span></p>'
echo '<br /><p class="center"><button name="page" value="status-kill-synotr" style="color: #BD0010;">(Beenden erzwingen?)</button></p><br />'
exit
else
if [ $callFrom = GUI ] ; then
echo '<p class="title">synOTR wurde gestartet ...</p><br><br><br><br>
<center><table id="system_msg" style="width: 40%;table-align: center;">
<tr>
<th style="width: 20%;"><img class="imageStyle" alt="status_loading" src="images/status_loading.gif" style="float:left;"></th>
<th style="width: 80%;"><p class="center"><span style="color: #424242;font-weight:normal;">Bitte warten, bis die Dateien<br>fertig abgearbeitet wurden.</span></p></th>
</tr>
</table></center>'
else
echo "synOTR wurde gestartet ..."
echo "Bitte warten, bis die Dateien fertig abgearbeitet wurden."
fi
echo '<p class="title">synOTR wurde gestartet ...</p><br><br><br><br>
<center><table id="system_msg" style="width: 40%;table-align: center;">
<tr>
<th style="width: 20%;"><img class="imageStyle" alt="status_loading" src="images/status_loading.gif" style="float:left;"></th>
<th style="width: 80%;"><p class="center"><span style="color: #424242;font-weight:normal;">Bitte warten, bis die Dateien<br>fertig abgearbeitet wurden.</span></p></th>
</tr>
</table></center>'
fi
# Variablenkorrektur für ältere Konfiguration.txt und Slash anpassen:
@ -55,12 +37,12 @@
fi
if [ -z $WORKDIR ] ; then
WORKDIR="${DESTDIR%/}/" # Variable WORKDIR nicht gesetzt. Es wird im Ausgabeordner gearbeitet!
# WORKDIR="${destdir%/}/"
WORKDIR="${DESTDIR%/}/"
# echo "Variable WORKDIR nicht gesetzt. Es wird im Ausgabeordner gearbeitet!"
else
WORKDIR="${WORKDIR%/}/"
fi
umask 000 # damit Files auch von anderen Usern bearbeitet werden können / http://openbook.rheinwerk-verlag.de/shell_programmierung/shell_011_003.htm
# LOGlevel=0 => Logging inaktiv / 1 => normal / 2 => erweitert
if [ $LOGlevel = "0" ] ; then
@ -69,14 +51,9 @@
DECODIR="${WORKDIR%/}/_decodiert"
if [ ! -d "$DESTDIR" ] || [ "$DESTDIR" = "/" ]; then
if [ $callFrom = GUI ] ; then
echo '
<p class="center"><span style="color: #BD0010;"><b>! ! ! Zielverzeichnis in der Konfiguration prüfen ! ! !</b><br>Programmlauf wird beendet.<br></span></p>'
else
echo "! ! ! Zielverzeichnis in der Konfiguration prüfen ! ! !"
echo "Programmlauf wird beendet."
fi
exit 1
echo '
<p class="center"><span style="color: #BD0010;"><b>! ! ! Zielverzeichnis in der Konfiguration prüfen ! ! !</b><br>Programmlauf wird beendet.<br></span></p>'
exit
fi
if [ $OTRcutactiv = "off" ] ; then

View file

@ -8,9 +8,8 @@
echo " -----------------------------------"
echo -e
CLIENTVERSION=$(get_key_value /var/packages/synOTR/INFO version)
set -E -o functrace # for function failure()
DevChannel="Release" # beta [2023-06-11]
CLIENTVERSION="4.0.8" # [2018-12-17]
DevChannel="Release" # beta
# ---------------------------------------------------------------------------------
# GRUNDKONFIGRUATIONEN / INDIVIDUELLE ANPASSUNGEN / Standardwerte |
@ -54,7 +53,6 @@
# Arbeitsverzeichnis auslesen und hineinwechseln:
# ---------------------------------------------------------------------
OLDIFS=$IFS # ursprünglichen Fieldseparator sichern
UNIXTIME=$(date +%s)
APPDIR=$(cd $(dirname $0);pwd)
cd ${APPDIR}
@ -124,7 +122,6 @@
# ffmpeg="${APPDIR}/app/bin/ffmpeg"
ffmpeg=`which ffmpeg` # mitgeliefertes ffmpeg läuft derzeit nicht korrekt
avcut="${APPDIR}/app/bin/avcut64"
ionice="${APPDIR}/app/bin/ionice64"
elif [ `echo $machinetyp | grep "armv7" ` ] ; then
synOTR_LD_LIBRARY_PATH=${APPDIR}/app/libARMv7l:$LD_LIBRARY_PATH
synOTR_PATH=$PATH:${APPDIR}/app/binARMv7l:/opt/bin
@ -132,10 +129,10 @@
ffmpeg="${APPDIR}/app/binARMv7l/ffmpeg"
avcut="${APPDIR}/app/binARMv7l/avcut"
if [[ `uname -a | grep "armadaxp" ` ]] ; then
#if [ $device = "ds214" ] || [ $device = "ds414" ] ; then
echo " alternative avcut-Version ohne asm wird verwendet"
avcut="${APPDIR}/app/binARMv7l/avcut_disable-asm"
fi
ionice="${APPDIR}/app/binARMv7l/ionice"
elif [ $machinetyp = "i686" ] ; then
bsy="${APPDIR}/app/bin/busybox"
# ffmpeg="${APPDIR}/app/bin/ffmpeg"
@ -143,7 +140,6 @@
avcut="${APPDIR}/app/bin/avcut32"
synOTR_LD_LIBRARY_PATH=$SAVED_LD_LIBRARY_PATH
synOTR_PATH=$PATH:${APPDIR}/app/bin
ionice="${APPDIR}/app/bin/ionice32"
elif [ $machinetyp = "x86_64" ] ; then
bsy="${APPDIR}/app/bin/busybox"
# ffmpeg="${APPDIR}/app/bin/ffmpeg"
@ -151,7 +147,6 @@
avcut="${APPDIR}/app/bin/avcut64"
synOTR_LD_LIBRARY_PATH=$SAVED_LD_LIBRARY_PATH
synOTR_PATH=$PATH:${APPDIR}/app/bin
ionice="${APPDIR}/app/bin/ionice64"
else
message="Deine CPU-Plattform [${machinetyp}] wird leider von synOTR nicht unterstützt oder ist nicht bekannt …"
echo "$message"
@ -169,10 +164,6 @@
synOTR_ENV
# alle Kommandos und Kindprozesse des Skriptes mit niedrigst möglicher Priorität ausgeführen:
echo "Priorität anpassen: $(renice -n 19 -p $$)"
echo " $($ionice -c 2 -n 7 -p $$)"
# Info der Datenbank auslesen:
# ---------------------------------------------------------------------
if [ -f "${APPDIR}/app/etc/synOTR.sqlite" ] ; then
@ -294,42 +285,10 @@
#################################################################################################
failure()
{
# this function show error line
# --------------------------------------------------------------
# https://unix.stackexchange.com/questions/462156/how-do-i-find-the-line-number-in-bash-when-an-error-occured
local lineno=$1
local msg=$2
echo "Failed at $lineno: $msg"
}
trap 'failure ${LINENO} "$BASH_COMMAND"' ERR
sec_to_time()
{
#########################################################################################
# diese Funktion wandelt einen Sekundenwert nach hh:mm #
# Aufruf: sec_to_time "string" #
# https://blog.jkip.de/in-bash-sekunden-umrechnen-in-stunden-minuten-und-sekunden/ #
#########################################################################################
local seconds=$1
local sign=""
if [[ ${seconds:0:1} == "-" ]]; then
seconds=${seconds:1}
sign="-"
fi
local hours=$(( seconds / 3600 ))
local minutes=$(( (seconds % 3600) / 60 ))
seconds=$(( seconds % 60 ))
printf "%s%02d:%02d:%02d" "$sign" $hours $minutes $seconds
}
MovieDB_query()
{
#########################################################################################
# Diese Funktion sucht auf MovieDB.com nach Filminformationen #
# Diese Funktion sucht auf theTVDB.com nach Serieninformationen #
#########################################################################################
echo -e
@ -432,7 +391,7 @@ echo -e ;
echo "Serverfehler (Zeitüberschreitung)"
fi
if jq -e . >/dev/null 2>&1 <<<"$episodeninfo"; then
episodetitle=` echo $episodeninfo | jq '.data[].episodeName' | sed "s/\"//g ; s/://g ; s/\?//g ; s/\*//g ; s/\?//g ; s/\///g" ` # | tr -d '"' `
episodetitle=` echo $episodeninfo | jq '.data[].episodeName' | sed "s/\"//g ; s/://g ; s/\?//g ; s/\*//g ; s/\?//g" ` # | tr -d '"' `
description=` echo $episodeninfo | jq '.data[].overview' | sed "s/\"//g" ` # | tr -d '"' `
else
echo "Serverantwort konnte nicht verarbeitet werden (kein kompatibles JSON)"
@ -560,7 +519,7 @@ elif [[ "$OTRID" =~ $regInt ]]; then # Ist die OTR-Id eine echte Zahl?
season="$(printf '%02d' "$season")" # 2stellig mit führender Null
episode=`echo "$serieninfo" | awk -F, '{print $4}' | awk -F: '{print $2}' | sed "s/\"//g"`
episode="$(printf '%02d' "$episode")" # 2stellig mit führender Null
episodetitle=`echo "$serieninfo" | jq -r '.Folgenname' | sed "s/\"//g ; s/://g ; s/\?//g ; s/\*//g ; s/\?//g ; s/\///g" `
episodetitle=`echo "$serieninfo" | jq -r '.Folgenname' | sed "s/://g" | sed "s/\?//g" | sed "s/\*//g" | sed "s/\?//g" `
description=`echo "$serieninfo" | jq -r '.Folgenbeschreibung' | sed "s/:/ -/g" `
wget --timeout=30 --tries=2 -q -O - "http://${synotrdomain}/synOTR/synOTR_FILECOUNT_OTRSERIEN" >/dev/null 2>&1
else
@ -609,7 +568,7 @@ OTRdecoder()
muxerror=0 # nur für Log
if [ -f "${DECODIR}/${videosourcetitle}.avi" ]; then
echo -e; echo "MUXING: ---> ${ac3filename}" #; echo -e
muxingLOG=$($ffmpeg -threads 2 -loglevel $ffloglevel -i "${DECODIR}/${videosourcetitle}.avi" -i "$i" -map 0:0 -map 1:0 -c:a copy -async 1 -c:v copy -sn -y "${DECODIR}/${videosourcetitle}.ac3tmp.avi" 2>&1)
muxingLOG=$(nice -n $niceness $ffmpeg -threads 2 -loglevel $ffloglevel -i "${DECODIR}/${videosourcetitle}.avi" -i "$i" -map 0:0 -map 1:0 -c:a copy -async 1 -c:v copy -sn -y "${DECODIR}/${videosourcetitle}.ac3tmp.avi" 2>&1)
if [ -f "${DECODIR}/${videosourcetitle}.ac3tmp.avi" ]; then
# Original löschen / umbenennen:
@ -660,16 +619,11 @@ if [ $decoderactiv = "on" ] && [ ! -z "$filetest" ] ; then
echo -n " "; date
if [ $machinetyp = "x86_64" ]; then
if [ "$(synogetkeyvalue /etc.defaults/VERSION buildnumber)" -ge 60000 ]; then
# verwende passenden Decoder ab DSM7.2:
otrdecoderLOG=$(otrdecoder64_72 -q -i "$i" -o "$DECODIR" -e "$OTRuser" -p "$OTRpw" 2>&1)
else
otrdecoderLOG=$(otrdecoder64 -q -i "$i" -o "$DECODIR" -e "$OTRuser" -p "$OTRpw" 2>&1)
fi
otrdecoderLOG=$(nice -n $niceness otrdecoder64 -q -i "$i" -o "$DECODIR" -e "$OTRuser" -p "$OTRpw" 2>&1)
elif [ $machinetyp = "i686" ]; then
otrdecoderLOG=$(otrdecoder32 -q -i "$i" -o "$DECODIR" -e "$OTRuser" -p "$OTRpw" 2>&1)
otrdecoderLOG=$(nice -n $niceness otrdecoder32 -q -i "$i" -o "$DECODIR" -e "$OTRuser" -p "$OTRpw" 2>&1)
elif [ `echo $machinetyp | grep "armv" ` ] ; then
otrdecoderLOG=$(otrpidecoder -d "$i" -O "${DECODIR}/${decofilename}" -e "$OTRuser" -p "$OTRpw" 2>&1)
otrdecoderLOG=$(nice -n $niceness otrpidecoder -d "$i" -O "${DECODIR}/${decofilename}" -e "$OTRuser" -p "$OTRpw" 2>&1)
fi
if [ $LOGlevel = "2" ] ; then
@ -731,18 +685,6 @@ if [ $decoderactiv = "on" ] && [ ! -z "$filetest" ] ; then
echo 2 > /dev/ttyS1 #short beep
sleep 1
fi
if [ ! -z $PBTOKEN ] ; then
PB_LOG=`curl $cURLloglevel --header "Access-Token:${PBTOKEN}" https://api.pushbullet.com/v2/pushes -d type=note -d title="synOTR" -d body="Film [$filename] ist fertig."`
if [ $LOGlevel = "2" ] ; then
echo " PushBullet-LOG:"
echo "$PB_LOG"
elif echo "$PB_LOG" | grep -q "error"; then # für Loglevel 1 nur Errorausgabe
echo -n " PushBullet-Error: "
echo "$PB_LOG" | jq -r '.error_code'
fi
else
echo " (PushBullet-TOKEN nicht gesetzt)"
fi
wget --timeout=30 --tries=2 -q -O - "http://${synotrdomain}/synOTR/synOTR_FILECOUNT" >/dev/null 2>&1
needindex=1
fi
@ -866,14 +808,18 @@ if [ $OTRcutactiv = "on" ] ; then
# ---------------------------------------------------------------------
film="$i" # Der komplette Filmname und gegebenfalls der Pfad
film_ohne_anfang="$i"
# CUTLIST=`basename "$film"` # Filmname ohne Pfad
# filmname=$CUTLIST
# filmname=`basename "$film"`
AC_nameLOG="Überprüfe um welches Aufnahmeformat es sich handelt --> "
# ToDo: Variablen streichen / vereinheitlichen:
# film_ohne_anfang > nur hier
# film_ohne_ende > nur hier und in Rename auskommentiert
# filmname > nur hier
# format > nur hier im Sinn von Qualität
# film_ohne_anfang nur hier
# film_ohne_ende nur hier und in Rename auskommentiert
# filmname nur hier
# format nur hier im Sinn von Qualität
if echo "$film_ohne_anfang" | grep -q ".HQ."; then #Wenn es sich um eine "HQ" Aufnahme handelt
@ -893,6 +839,7 @@ if [ $OTRcutactiv = "on" ] ; then
AC_nameLOG="${AC_nameLOG}avi"
fi
if echo "$film" | grep / >> /dev/null; then # Wenn der Dateiname einen Pfad enthält
film_ohne_anfang=${film##*/} # Filmname ohne Pfad
if echo "$film_ohne_anfang" | grep -q ".HQ."; then #Wenn es sich um eine "HQ" Aufnahme handelt
@ -907,6 +854,7 @@ if [ $OTRcutactiv = "on" ] ; then
fi
fi
if echo "$film_ohne_anfang" | grep -q ".HQ."; then
outputfile="${WORKDIR}$film_ohne_ende.HQ-cut.avi"
# outputfile="${WORKDIR}$film_ohne_ende.mpg.HQ-cut.avi"
@ -932,6 +880,8 @@ if [ $OTRcutactiv = "on" ] ; then
filesize=$(ls -l "$film" | awk '{ print $5 }') #Dateigröße des Filmes
goodCount=0 #Passende Cutlists
arraylocal=1 #Nummer des Arrays
# vorhanden=no ## nehme erstmal an, es wurde keine Cutlist gefunden
# continue=1
for f in $local_cutlists; do
echo -n "Überprüfe ob eine der gefundenen Cutlists zum Film passt --> "
if [ -z $f ]; then
@ -1099,6 +1049,9 @@ if [ $OTRcutactiv = "on" ] ; then
sed -n '/<\/'$1'>/p' "$tmp/search.xml" | sed -n ''$2'p' | sed 's/<'$1'>//' | sed 's/<\/'$1'>//g' | sed 's/^[ \t]*//'
}
# inputfilename="$filename" # < 2018-06-12
# filmdateiname=`basename $film` # < 2018-06-12
continue=0
filesize=$(ls -l "$film" | awk '{ print $5 }')
filesizeMB=$(echo | gawk '{print '$filesize'/1000000}' | awk '{printf "%.2f\n", $1}')
@ -1145,6 +1098,7 @@ if [ $OTRcutactiv = "on" ] ; then
echo -e " L==> Es wurde leider keine Cutlist gefunden!"
else
sed -i 's/<rating><\/rating>/<rating>0.00<\/rating>/g' "$tmp/search.xml" # fehlendes rating durch 0.00 ersetzen / -i ändert die Quelldatei
# sed -i 's/ //g' "$tmp/search.xml" # führende Tabs entfernen / brachte Parsing durcheinander - lag möglicherweise doch an Dos-Zeilenenden
sed -i $'s/\r$//' "$tmp/search.xml" # convert Dos to Unix
cutlist_anzahl=$(grep --text -c '/cutlist' "$tmp/search.xml" | /usr/bin/tr -d "\r")
@ -1375,7 +1329,7 @@ if [ $OTRcutactiv = "on" ] ; then
usercomment=""
CL_serieninfofound=0
SuggestedMovieName=`cat "$tmp/$CUTLIST" | grep "SuggestedMovieName=" | sed "s/SuggestedMovieName\=//g;s/[0-9]\{2,4\}[.][0-9]\{1,2\}[.][0-9]\{1,2\}[ _][0-9]\{2\}[\-][0-9]\{2\}/Datum_Zeit/g;s/[0-9]\{2,4\}[.][0-9]\{1,2\}[.][0-9]\{1,2\}/Datum/g;s/_/ /g" | /usr/bin/tr -d "\r" ` #| awk -F. '{print $1}'` # Datum, Zeit im OTR-Format und Unterstriche werden entfernt
usercomment=`cat "$tmp/$CUTLIST" | grep "UserComment=" | sed "s/UserComment\=//g;s/[0-9]\{2,4\}[.][0-9]\{1,2\}[.][0-9]\{1,2\}[ _][0-9]\{2\}[\-][0-9]\{2\}/Datum_Zeit/g;s/[0-9]\{2,4\}[.][0-9]\{1,2\}[.][0-9]\{1,2\}/Datum/g;s/_/ /g" | /usr/bin/tr -d "\r" ` #| awk -F. '{print $1}'`
usercomment=`cat "$tmp/$CUTLIST" | grep "usercomment=" | sed "s/usercomment\=//g;s/[0-9]\{2,4\}[.][0-9]\{1,2\}[.][0-9]\{1,2\}[ _][0-9]\{2\}[\-][0-9]\{2\}/Datum_Zeit/g;s/[0-9]\{2,4\}[.][0-9]\{1,2\}[.][0-9]\{1,2\}/Datum/g;s/_/ /g" | /usr/bin/tr -d "\r" ` #| awk -F. '{print $1}'`
if echo "$SuggestedMovieName" | grep -q "[sST]\?[0-9]\{1,2\}[.\-xX]\?[eE]\?[0-9]\{1,2\}" ; then # [[:space:]] # S01E01 / S01.E01 / 01-01 / 01x01 / teilweise ohne führende Null
#CL_serieninfo=$(parseRegex "$SuggestedMovieName" ".[sST]?[0-9]{1,2}[.\-xX]?[eE]?[0-9]{1,2}" | head -n1) # head -n1: nur der erste Fund im String wird verwendet
@ -1591,9 +1545,9 @@ if [ $OTRcutactiv = "on" ] ; then
# für ARMv7 unterstützt avcut noch nicht die Operanten -i & -o ==> Abhilfe: avcut-0.4 für ARMv7 kompilieren (ohne Nachteil)
if [ $machinetyp = "x86_64" ] || [ $machinetyp = "i686" ]; then
AVCUTLOG=$(time $avcut -p "${APPDIR}/includes/avcut_otr.profile" -i "$film" -o "$outputfile" $time 2>&1) # Befehl ausführen
AVCUTLOG=$(time nice -n $niceness $avcut -p "${APPDIR}/includes/avcut_otr.profile" -i "$film" -o "$outputfile" $time 2>&1) # Befehl ausführen
else
AVCUTLOG=$(time $avcut "$film" "$outputfile" $time 2>&1) # noch avcut v0.2 mit entsprechender Parameterangabe
AVCUTLOG=$(time nice -n $niceness $avcut "$film" "$outputfile" $time 2>&1) # noch avcut v0.2 mit entsprechender Parameterangabe
fi
echo -e; echo -n "Die Schnittpunkte befinden sich"
@ -1605,7 +1559,7 @@ if [ $OTRcutactiv = "on" ] ; then
fi
else
echo "> Übergebe die Cuts an avisplit/avimerge"
AVISPLITLOG=$(avisplit -i "$film" -o "$outputfile" -t $time -c 1>/dev/null) # Hier wird avisplit gestartet, avimerge wird on-the-fly über den Parameter -c gestartet
AVISPLITLOG=$(nice -n $niceness avisplit -i "$film" -o "$outputfile" -t $time -c 1>/dev/null) # Hier wird avisplit gestartet, avimerge wird on-the-fly über den Parameter -c gestartet
if [ $LOGlevel = "2" ] ; then
echo "avisplit Command: avisplit -i $film -o $outputfile -t $time -c"
echo "avisplit-LOG: $AVISPLITLOG"
@ -1623,18 +1577,6 @@ if [ $OTRcutactiv = "on" ] ; then
if [ $dsmbeepnotify = "on" ] ; then
echo 2 > /dev/ttyS1 #short beep
fi
if [ ! -z $PBTOKEN ] ; then
PB_LOG=`curl $cURLloglevel --header "Access-Token:${PBTOKEN}" https://api.pushbullet.com/v2/pushes -d type=note -d title="synOTR" -d body="Film [$filedestname] ist fertig."`
if [ $LOGlevel = "2" ] ; then
echo " PushBullet-LOG:"
echo "$PB_LOG"
elif echo "$PB_LOG" | grep -q "error"; then # für Loglevel 1 nur Errorausgabe
echo -n " PushBullet-Error: "
echo "$PB_LOG" | jq -r '.error_code'
fi
else
echo " (PushBullet-TOKEN nicht gesetzt)"
fi
wget --timeout=30 --tries=2 -q -O - "http://${synotrdomain}/synOTR/synOTR_FILECOUNT" >/dev/null 2>&1
needindex=1
fi
@ -1757,9 +1699,9 @@ if [ $OTRcutactiv = "on" ] ; then
echo "okey"
LOCAL_CUTLIST="${i}.cutlist"
AC_getlocalcutlist_withoutCheck
elif [ -f "${OTRkeydir}${filename}.cutlist" ]; then # die Cutlist muss sich im Downloadordner / Quellordner befinden und den gleichen Namen wie der Film haben (inkl. Dateiendung .avi / .mp4 vor .cutlist)
elif [ -f "${OTRkeydir}/${filename}.cutlist" ]; then # die Cutlist muss sich im Downloadordner / Quellordner befinden und den gleichen Namen wie der Film haben (inkl. Dateiendung .avi / .mp4 vor .cutlist)
echo "okey"
LOCAL_CUTLIST="${OTRkeydir}${filename}.cutlist"
LOCAL_CUTLIST="${OTRkeydir}/${filename}.cutlist"
AC_getlocalcutlist_withoutCheck
else
echo -e "Keine lokale Cutlist gefunden!"
@ -1807,7 +1749,7 @@ if [ $OTRcutactiv = "on" ] ; then
if [ $dsmtextnotify = "on" ] ; then
title=${filename%.*}
sleep 1
synodsmnotify $MessageTo "synOTR" "Film [$title] ist fertig"
synodsmnotify $MessageTo "synOTR" "[$title] ist fertig"
sleep 1
fi
if [ $dsmbeepnotify = "on" ] ; then
@ -1815,18 +1757,6 @@ if [ $OTRcutactiv = "on" ] ; then
echo 2 > /dev/ttyS1 #short beep
sleep 1
fi
if [ ! -z $PBTOKEN ] ; then
PB_LOG=`curl $cURLloglevel --header "Access-Token:${PBTOKEN}" https://api.pushbullet.com/v2/pushes -d type=note -d title="synOTR" -d body="Film [$title] ist fertig."`
if [ $LOGlevel = "2" ] ; then
echo " PushBullet-LOG:"
echo "$PB_LOG"
elif echo "$PB_LOG" | grep -q "error"; then # für Loglevel 1 nur Errorausgabe
echo -n " PushBullet-Error: "
echo "$PB_LOG" | jq -r '.error_code'
fi
else
echo " (PushBullet-TOKEN nicht gesetzt)"
fi
wget --timeout=30 --tries=2 -q -O - "http://${synotrdomain}/synOTR/synOTR_FILECOUNT" >/dev/null 2>&1
needindex=1
fi
@ -1922,7 +1852,7 @@ if [ $OTRavi2mp4active = "on" ] && [ ! -z "$filetest" ] ; then
# ------- DEMUX:
# ------- Audio extrahieren / konvertieren:
AUDIODEMUXINFO=$($ffmpeg -loglevel $ffloglevel -i "$i" -c:a copy -vn "$audiofile" 2>&1)
AUDIODEMUXINFO=$(nice -n $niceness $ffmpeg -loglevel $ffloglevel -i "$i" -c:a copy -vn "$audiofile" 2>&1)
if [ $LOGlevel = "2" ] ; then #aufgeblähtes LOG bei AC3-Audio …
echo "ffmpeg-AudioDemux LOG: $AUDIODEMUXINFO"
fi
@ -1944,19 +1874,19 @@ if [ $OTRavi2mp4active = "on" ] && [ ! -z "$filetest" ] ; then
# ------- Audio normalisieren:
volumeinfo=$(ffmpeg -i "$audiofile" -af "volumedetect" -f null - 2>&1 | awk '-F: ' '/max_volume/ { gsub(/ .*/, "", $2); print $2 }' | sed 's/-//g') # |grep max_volume | awk -F: '{ print $2 }' | sed 's/ dB//g' | sed 's/ -//g')
echo "Lautstärkeanhebung um: $volumeinfo dB"
convertLOG=$($ffmpeg -threads 2 -loglevel $ffloglevel -i "$audiofile" -c:a libfdk_aac -b:a "${OTRaacqal%k}k" -af "volume=$volumeinfo"dB "$audiofile.m4a" 2>&1)
convertLOG=$(nice -n $niceness $ffmpeg -threads 2 -loglevel $ffloglevel -i "$audiofile" -c:a libfdk_aac -b:a "${OTRaacqal%k}k" -af "volume=$volumeinfo"dB "$audiofile.m4a" 2>&1)
else
convertLOG=$($ffmpeg -threads 2 -loglevel $ffloglevel -i "$audiofile" -c:a libfdk_aac -b:a "${OTRaacqal%k}k" "$audiofile.m4a" 2>&1)
convertLOG=$(nice -n $niceness $ffmpeg -threads 2 -loglevel $ffloglevel -i "$audiofile" -c:a libfdk_aac -b:a "${OTRaacqal%k}k" "$audiofile.m4a" 2>&1)
fi
elif $(echo "$encoders" | grep -q "AAC (Advanced Audio Coding)" ) ; then # Native FFmpeg AAC encoder
echo "Erkannter Encoder: nativ (ffmpeg > 3.0) [2.Wahl]"
if [ $normalizeAudio = "on" ] ; then
if [ $normalizeAudio = "on_" ] ; then
# ------- Audio normalisieren:
volumeinfo=$(ffmpeg -i "$audiofile" -af "volumedetect" -f null - 2>&1 | awk '-F: ' '/max_volume/ { gsub(/ .*/, "", $2); print $2 }' | sed 's/-//g') # |grep max_volume | awk -F: '{ print $2 }' | sed 's/ dB//g' | sed 's/ -//g')
echo "Lautstärkeanhebung um: $volumeinfo dB"
convertLOG=$($ffmpeg -loglevel $ffloglevel -threads 2 -i "$audiofile" -c:a aac -strict -2 -b:a "${OTRaacqal%k}k" -af "volume=$volumeinfo"dB "$audiofile.m4a" 2>&1)
convertLOG=$(nice -n $niceness $ffmpeg -loglevel $ffloglevel -threads 2 -i "$audiofile" -c:a aac -strict -2 -b:a "${OTRaacqal%k}k" -af "volume=$volumeinfo"dB "$audiofile.m4a" 2>&1)
else
convertLOG=$($ffmpeg -loglevel $ffloglevel -threads 2 -i "$audiofile" -c:a aac -strict -2 -b:a "${OTRaacqal%k}k" "$audiofile.m4a" 2>&1)
convertLOG=$(nice -n $niceness $ffmpeg -loglevel $ffloglevel -threads 2 -i "$audiofile" -c:a aac -strict -2 -b:a "${OTRaacqal%k}k" "$audiofile.m4a" 2>&1)
fi
elif $(echo "$encoders" | grep -q libfaac ) ; then # libfaac > syno-ffmpeg
echo "Erkannter Encoder: libfaac [3.Wahl]"
@ -1967,9 +1897,9 @@ if [ $OTRavi2mp4active = "on" ] && [ ! -z "$filetest" ] ; then
# ------- Audio normalisieren:
volumeinfo=$(ffmpeg -i "$audiofile" -af "volumedetect" -f null - 2>&1 | awk '-F: ' '/max_volume/ { gsub(/ .*/, "", $2); print $2 }' | sed 's/-//g') # |grep max_volume | awk -F: '{ print $2 }' | sed 's/ dB//g' | sed 's/ -//g')
echo "Lautstärkeanhebung um: $volumeinfo dB"
convertLOG=$($ffmpeg -loglevel $ffloglevel -threads 2 -i "$audiofile" -acodec libfaac -ab "${OTRaacqal%k}k" -af "volume=$volumeinfo"dB "$audiofile.m4a" 2>&1)
convertLOG=$(nice -n $niceness $ffmpeg -loglevel $ffloglevel -threads 2 -i "$audiofile" -acodec libfaac -ab "${OTRaacqal%k}k" -af "volume=$volumeinfo"dB "$audiofile.m4a" 2>&1)
else
convertLOG=$($ffmpeg -loglevel $ffloglevel -threads 2 -i "$audiofile" -acodec libfaac -ab "${OTRaacqal%k}k" "$audiofile.m4a" 2>&1)
convertLOG=$(nice -n $niceness $ffmpeg -loglevel $ffloglevel -threads 2 -i "$audiofile" -acodec libfaac -ab "${OTRaacqal%k}k" "$audiofile.m4a" 2>&1)
fi
else
echo " finde keinen ffmpeg-Audioencoder!"; echo " Gebe den Pfad zu einer aac-kompatiblen ffmpeg-Version an."
@ -1987,7 +1917,7 @@ if [ $OTRavi2mp4active = "on" ] && [ ! -z "$filetest" ] ; then
fi
# ------- Video extrahieren:
VIDEODEMUXINFO=$($ffmpeg -loglevel $ffloglevel -i "$i" -an -c:v copy "$videofile" 2>&1)
VIDEODEMUXINFO=$(nice -n $niceness $ffmpeg -loglevel $ffloglevel -i "$i" -an -c:v copy "$videofile" 2>&1)
if [ $LOGlevel = "2" ] ; then #aufgeblähtes LOG bei AC3-Audio …
echo "ffmpeg-VideoDemux LOG:"
echo "$VIDEODEMUXINFO"
@ -2014,9 +1944,9 @@ if [ $OTRavi2mp4active = "on" ] && [ ! -z "$filetest" ] ; then
echo "Audio-Video-Sync: Audio wird um ${AUDIODELAY}ms verzögert"
videofiledelay="$videofile"
fi
mp4box $mp4boxloglevel -add "$videofiledelay" -add "$audiofiledelay" -fps $fps -tmp "$pfad" "${pfad}${title}.mp4"
nice -n $niceness mp4box $mp4boxloglevel -add "$videofiledelay" -add "$audiofiledelay" -fps $fps -tmp "$pfad" "${pfad}${title}.mp4"
else
mp4box $mp4boxloglevel -add "$videofile" -add "$audiofile" -fps $fps -tmp "$pfad" "${pfad}${title}.mp4"
nice -n $niceness mp4box $mp4boxloglevel -add "$videofile" -add "$audiofile" -fps $fps -tmp "$pfad" "${pfad}${title}.mp4"
fi
# ------- Temp löschen:
@ -2039,7 +1969,7 @@ if [ $OTRavi2mp4active = "on" ] && [ ! -z "$filetest" ] ; then
synoindex -a "${pfad}${title}.mp4"
if [ $dsmtextnotify = "on" ] ; then
sleep 1
synodsmnotify $MessageTo "synOTR" "Film [$title] ist fertig"
synodsmnotify $MessageTo "synOTR" "[$title] ist fertig"
sleep 1
fi
if [ $dsmbeepnotify = "on" ] ; then
@ -2047,18 +1977,6 @@ if [ $OTRavi2mp4active = "on" ] && [ ! -z "$filetest" ] ; then
echo 2 > /dev/ttyS1 #short beep
sleep 1
fi
if [ ! -z $PBTOKEN ] ; then
PB_LOG=`curl $cURLloglevel --header "Access-Token:${PBTOKEN}" https://api.pushbullet.com/v2/pushes -d type=note -d title="synOTR" -d body="Film [$title] ist fertig."`
if [ $LOGlevel = "2" ] ; then
echo " PushBullet-LOG:"
echo "$PB_LOG"
elif echo "$PB_LOG" | grep -q "error"; then # für Loglevel 1 nur Errorausgabe
echo -n " PushBullet-Error: "
echo "$PB_LOG" | jq -r '.error_code'
fi
else
echo " (PushBullet-TOKEN nicht gesetzt)"
fi
wget --timeout=30 --tries=2 -q -O - "http://${synotrdomain}/synOTR/synOTR_FILECOUNT" >/dev/null 2>&1
needindex=1
fi
@ -2248,7 +2166,7 @@ for i in $(find "$WORKDIR" -maxdepth 1 -name "*TVOON*avi" -o -name "*TVOON*mp4"
scantype="i"
fi
scantype="" # deaktiviert
# echo "Scantype: ${scantype}"
# echo "Scantype: ${scantype}"
# ------------------ Auflösung:
height=`echo "$ffprobeInfo" | jq '.streams[0].height' `
echo "Auflösung Höhe: ${height}"
@ -2329,7 +2247,7 @@ for i in $(find "$WORKDIR" -maxdepth 1 -name "*TVOON*avi" -o -name "*TVOON*mp4"
# --description
# --artwork
# --genre
AtomicParsleyLOG=$(AtomicParsley "${WORKDIR}${NewName}" --overWrite --TVNetwork "$Channel" --TVShowName "$serietitle" --TVEpisode "$episodetitle" --TVSeasonNum "$season" --TVEpisodeNum "$episode" --title "$title" 2>&1)
AtomicParsleyLOG=$(nice -n $niceness AtomicParsley "${WORKDIR}${NewName}" --overWrite --TVNetwork "$Channel" --TVShowName "$serietitle" --TVEpisode "$episodetitle" --TVSeasonNum "$season" --TVEpisodeNum "$episode" --title "$title" 2>&1)
if [ $LOGlevel = "2" ] ; then
echo " AtomicParsleyLOG= $AtomicParsleyLOG"
fi
@ -2367,7 +2285,7 @@ for i in $(find "$WORKDIR" -maxdepth 1 -name "*TVOON*avi" -o -name "*TVOON*mp4"
synoindex -a "${WORKDIR}${NewName}"
if [ $dsmtextnotify = "on" ] ; then
sleep 1
synodsmnotify $MessageTo "synOTR" "Film [$title] ist fertig"
synodsmnotify $MessageTo "synOTR" "[$title] ist fertig"
sleep 1
fi
if [ $dsmbeepnotify = "on" ] ; then
@ -2375,18 +2293,6 @@ for i in $(find "$WORKDIR" -maxdepth 1 -name "*TVOON*avi" -o -name "*TVOON*mp4"
echo 2 > /dev/ttyS1 #short beep
sleep 1
fi
if [ ! -z $PBTOKEN ] ; then
PB_LOG=`curl --header "Access-Token:${PBTOKEN}" https://api.pushbullet.com/v2/pushes -d type=note -d title="synOTR" -d body="Filme [$film] ist fertig."`
if [ $LOGlevel = "2" ] ; then
echo "PushBullet-LOG:"
echo "$PB_LOG"
elif echo "$PB_LOG" | grep -q "error"; then # für Loglevel 1 nur Errorausgabe
echo -n "PushBullet-Error: "
echo "$PB_LOG" | jq -r '.error_code'
fi
else
echo "PushBullet-TOKEN nicht erkannt"
fi
wget --timeout=30 --tries=2 -q -O - "http://${synotrdomain}/synOTR/synOTR_FILECOUNT" >/dev/null 2>&1
needindex=1
fi
@ -2493,11 +2399,12 @@ if [ $OTRrenameactiv = "on" ] && [ $firstrunonday == "1" ] ; then
echo " -> SQLupdate: $sSQLupdate"
fi
sqlite3 ${APPDIR}/app/etc/synOTR.sqlite "$sSQLupdate"
# elif [ ! -z "$serieninfo" ] ; then # ist nicht zuverlässig < 2018-06-14
elif [[ "$OTRID" =~ $regInt ]]; then # Ist die OTR-Id eine echte Zahl?
if jq -e . >/dev/null 2>&1 <<<"$serieninfo"; then # prüfen, ob korrektes JSON-Format verarbeitet werden kann (https://stackoverflow.com/questions/46954692/check-if-string-is-a-valid-json-with-jq)
echo -e "gefunden:"
echo "OTRID: $OTRID"
serietitle=`echo "$serieninfo" | jq -r '.Serie' | sed "s/://g" `
serietitle=`echo "$serieninfo" | jq -r '.Serie' | sed "s/://g" ` # jq ist ein Kommandozeilen-JSON-Parser
echo "serietitle: $serietitle"
season=`echo "$serieninfo" | awk -F, '{print $3}' | awk -F: '{print $2}' | sed "s/\"//g"`
season="$(printf '%02d' "$season")" # 2stellig mit führender Null
@ -2573,7 +2480,7 @@ if [ $OTRrenameactiv = "on" ] && [ $firstrunonday == "1" ] ; then
# --description
# --artwork
# --genre
AtomicParsleyLOG=$(AtomicParsley "${DESTDIR}/$NewName" --overWrite --TVNetwork "$Channel" --TVShowName "$serietitle" --TVEpisode "$episodetitle" --TVSeasonNum "$season" --TVEpisodeNum "$episode" --title "$title" 2>&1)
AtomicParsleyLOG=$(nice -n $niceness AtomicParsley "${DESTDIR}/$NewName" --overWrite --TVNetwork "$Channel" --TVShowName "$serietitle" --TVEpisode "$episodetitle" --TVSeasonNum "$season" --TVEpisodeNum "$episode" --title "$title" 2>&1)
if [ $LOGlevel = "2" ] ; then
echo " AtomicParsleyLOG= $AtomicParsleyLOG"
fi
@ -2606,7 +2513,7 @@ if [ $OTRrenameactiv = "on" ] && [ $firstrunonday == "1" ] ; then
if [ $dsmtextnotify = "on" ] ; then
sleep 1
synodsmnotify $MessageTo "synOTR" "Film [$title] ist fertig"
synodsmnotify $MessageTo "synOTR" "[$title] ist fertig"
sleep 1
fi
if [ $dsmbeepnotify = "on" ] ; then
@ -2639,6 +2546,7 @@ if [ $OTRrenameactiv = "on" ] && [ $firstrunonday == "1" ] ; then
sqlite3 ${APPDIR}/app/etc/synOTR.sqlite "$sSQLupdate"
fi
sleep 15 # Wartezeit in Sekunden, um die Serverlast auf otr-serien.de zu reduzieren
# date
else
echo " -> nicht gefunden: $file_rename"
echo " L==> Datei liegt nicht mehr im Zielordner [$WORKDIR]"
@ -2804,7 +2712,7 @@ if [ $useWORKDIR == "yes" ] && [ ! -z "$filetest" ]; then
if [ $dsmtextnotify = "on" ] ; then
sleep 1
synodsmnotify $MessageTo "synOTR" "Film [$filename] ist fertig"
synodsmnotify $MessageTo "synOTR" "[$filename] ist fertig"
sleep 1
fi
if [ $dsmbeepnotify = "on" ] ; then
@ -2812,18 +2720,6 @@ if [ $useWORKDIR == "yes" ] && [ ! -z "$filetest" ]; then
echo 2 > /dev/ttyS1 #short beep
sleep 1
fi
if [ ! -z $PBTOKEN ] ; then
PB_LOG=`curl $cURLloglevel --header "Access-Token:${PBTOKEN}" https://api.pushbullet.com/v2/pushes -d type=note -d title="synOTR" -d body="Film [$filename] ist fertig."`
if [ $LOGlevel = "2" ] ; then
echo " PushBullet-LOG:"
echo "$PB_LOG"
elif echo "$PB_LOG" | grep -q "error"; then # für Loglevel 1 nur Errorausgabe
echo -n " PushBullet-Error: "
echo "$PB_LOG" | jq -r '.error_code'
fi
else
echo " (PushBullet-TOKEN nicht gesetzt)"
fi
wget --timeout=30 --tries=2 -q -O - "http://${synotrdomain}/synOTR/synOTR_FILECOUNT" >/dev/null 2>&1
needindex=1
@ -2848,7 +2744,7 @@ if [ $useWORKDIR == "yes" ] && [ ! -z "$filetest" ]; then
if [ $dsmtextnotify = "on" ] ; then
sleep 1
synodsmnotify $MessageTo "synOTR" "Film [$filename] ist fertig"
synodsmnotify $MessageTo "synOTR" "[$filename] ist fertig"
sleep 1
fi
if [ $dsmbeepnotify = "on" ] ; then
@ -2856,18 +2752,6 @@ if [ $useWORKDIR == "yes" ] && [ ! -z "$filetest" ]; then
echo 2 > /dev/ttyS1 #short beep
sleep 1
fi
if [ ! -z $PBTOKEN ] ; then
PB_LOG=`curl $cURLloglevel --header "Access-Token:${PBTOKEN}" https://api.pushbullet.com/v2/pushes -d type=note -d title="synOTR" -d body="Film [$filename] ist fertig."`
if [ $LOGlevel = "2" ] ; then
echo " PushBullet-LOG:"
echo "$PB_LOG"
elif echo "$PB_LOG" | grep -q "error"; then # für Loglevel 1 nur Errorausgabe
echo -n " PushBullet-Error: "
echo "$PB_LOG" | jq -r '.error_code'
fi
else
echo " (PushBullet-TOKEN nicht gesetzt)"
fi
wget --timeout=30 --tries=2 -q -O - "http://${synotrdomain}/synOTR/synOTR_FILECOUNT" >/dev/null 2>&1
needindex=1
else
@ -2897,73 +2781,6 @@ if [ -f "/usr/syno/bin/synoindex" ] && [ $firstrunonday == "1" ] && [ $reindex =
fi
}
PURGELOG()
{
#########################################################################################
# Diese Funktion löscht zu erst alle leeren Logs und anschließend die überzähligen #
#########################################################################################
if [ -z $LOGmax ]; then
return
fi
logdir="${DECODIR}/_LOGsynOTR/"
# leere Logs löschen:
for i in $(ls -tr "${logdir}" | egrep -o '^synOTR.*.log$') # Auflistung aller LOG-Dateien
do
if [ $( cat "${logdir}$i" | tail -n9 | head -n4 | wc -c ) -le 15 ] && cat "${logdir}$i" | grep -q "synOTR ENDE" ; then
if [ $endgueltigloeschen = "on" ] ; then
rm "${logdir}$i"
else
mv "${logdir}$i" "$OTRkeydeldir"
fi
fi
done
# überzählige Logs löschen:
count2del=$( expr $( ls -t "${logdir}" | egrep -o '^synOTR.*.log$' | wc -l ) - $LOGmax ) # wie viele Dateien sind überzählig
if [ $count2del -ge 0 ]; then
for i in `ls -tr "${logdir}" | egrep -o '^synOTR.*.log$' | head -n${count2del} `
do
if [ $endgueltigloeschen = "on" ] ; then
rm "${logdir}$i"
else
mv "${logdir}$i" "$OTRkeydeldir"
fi
done
fi
# überzählige searches löschen:
count2del=$( expr $(ls -t "${logdir}" | egrep -o '^search.*.xml$' | wc -l) - $LOGmax )
if [ ${count2del} -ge 0 ]; then
for i in `ls -tr "${logdir}" | egrep -o '^search.*.xml$' | head -n${count2del} `
do
if [ $endgueltigloeschen = "on" ] ; then
rm "${logdir}$i"
else
mv "${logdir}$i" "$OTRkeydeldir"
fi
done
fi
# überzählige cutlists löschen:
count2del=$( expr $(ls -t "${logdir}" | egrep -o '.*.cutlist$' | wc -l) - $LOGmax )
if [ ${count2del} -ge 0 ]; then
for i in `ls -tr "${logdir}" | egrep -o '.*.cutlist$' | head -n${count2del} `
do
if [ $endgueltigloeschen = "on" ] ; then
rm "${logdir}$i"
else
mv "${logdir}$i" "$OTRkeydeldir"
fi
done
fi
}
# _______________________________________________________________________________
# | |
# | AUFRUF DER FUNKTIONEN |
@ -2979,15 +2796,14 @@ fi
OTRautocut
OTRavi2mp4
OTRrename
# OTRopenrename # 2019-10 deaktivert, da otr-serien.de die Pflege neuer Serien eingestellt hat
OTRopenrename
MOVE2DESTDIR
FRESHUPMEDIAINDEX
PURGELOG
echo -e; echo -e
echo " -----------------------------------"
echo " | ==> synOTR ENDE <== |"
echo " -----------------------------------"
echo -e; echo " Gesamtzeit: $(sec_to_time $(expr $(date +%s)-${UNIXTIME}) )"
exit

View file

@ -156,8 +156,7 @@ timer_scriptname="/usr/syno/synoman/webman/3rdparty/synOTR/synOTR-start.sh"
<p>&nbsp;</p>
<div class="title">Zeitplan einrichten</div>
<div class="info">
<h3>&raquo; 1. Wie oft soll synOTR pro Tag (pro Woche) ausgeführt werden?<br>
<span style="color: #BD0010;">INFO: Der DSM-Sicherheitsbereater wird den zusätzlichen Croneintrag (da für DSM unbekannt) bemängeln!</span></h3>
<h3>&raquo; 1. Wie oft soll synOTR pro Tag (pro Woche) ausgeführt werden?</h3>
<div>
<div>
<input class="left" type="radio" id="radio-one" name="timer_times" value="one" '${checked_one:+checked}' '${disable_times:+disabled}'/>

View file

@ -28,15 +28,9 @@
if ! cat ./$CONFIG | grep -q "dsmbeepnotify" ; then
echo "dsmbeepnotify=\"on\"" >> ./$CONFIG
fi
if ! cat ./$CONFIG | grep -q "PBTOKEN" ; then
echo "PBTOKEN=\"\"" >> ./$CONFIG
fi
if ! cat ./$CONFIG | grep -q "LOGlevel" ; then
echo "LOGlevel=\"1\"" >> ./$CONFIG
fi
if ! cat ./$CONFIG | grep -q "LOGmax" ; then
echo "LOGmax=\"1\"" >> ./$CONFIG
fi
if ! cat ./$CONFIG | grep -q "reindex" ; then
echo "reindex=\"1\"" >> ./$CONFIG
fi

View file

@ -49,10 +49,8 @@ MP4BOX_DELAY="100"
#--------------------------------------------------------------------
dsmtextnotify="on"
MessageTo="admin"
PBTOKEN=""
dsmbeepnotify="on"
LOGlevel="1"
LOGmax=""
reindex=1
#--------------------------------------------------------------------

View file

@ -1,35 +1,4 @@
Release Notes
4.2.2 (2023-06-11)
IMPLEMENTIERUNGEN:
- OTR-Decoder (x86_64) für DSM7.2 ergänzt
4.2.1 (2021-05-11)
IMPLEMENTIERUNGEN:
- OTR-Decoder (x86_64) aktualisiert
4.2.0 (RELEASE)
IMPLEMENTIERUNGEN:
- die I/O-Priorität wurde herabgesetzt (möglicherweise nur auf x86_64 / i386 und ARMv7 ungetestet)
- das nachträgliche Suchen von Serieninformationen auf otr-serien.de wurde deaktiviert, da die Informationspflege auf der Seite eingestellt wurde.
BUGFIXES:
- es wurde ein Fehler behoben, aufgrund dessen synOTR gestartet werden konnte, obwohl der vorhergehende Arbeitsablauf noch nicht abgeschlossen war
- bestimmte Sonderzeichen im Episodentitel von thetvdb führten zu einer fehlerhaften Umbenennung
4.1.1 (RELEASE)
IMPLEMENTIERUNGEN:
- Die Berechtigung für das Paket synOTR kann in der DSM-Systemsteuerung > Berechtigung für einzelne User konfiguriert werden (bitte beachte, dass nur eine gemeinsame Konfiguration verwendet wird!).
BUGFIXES:
- es wurde ein Fehler behoben, aufgrund dessen aus dem Autorkommentar einer Cutlist keine Serieninformation abgeleitet werden konnte (der Parameter wurde scheinbar umbenannt).
4.1.0 (RELEASE)
IMPLEMENTIERUNGEN:
- PushBullet integriert. Dazu muss lediglich der persönliche Token in der Konfiguration hinterlegt werden
- Die max. Anzahl von LOGs kann nun begrenzt werden. Dadurch werden zu erst alle leeren Logs und anschließend die überzähligen gelöscht
BUGFIXES:
- es wurde ein Fehler behoben, dass bei aktivem nativen aac-Encoder keine Normalisierung der Tonspur möglich war
- Detailänderungen in der GUI
- Detailänderungen der Benachrichtigungstexte
Release Notes
4.0.8 (RELEASE)
BUGFIXES:

View file

@ -1,17 +1,15 @@
package="synOTR"
displayname="synOTR"
version="4.2.2"
version="4.0.8"
thirdparty="yes"
description="SynOTR provides a workflow for TV recordings from onlineTVrecorder (OTR / https://onlinetvrecorder.com) for Synology NAS. synOTR performs *decoding *AC3-muxing (BETA) *cutting *MP4 conversion and *renaming (including Series information from www.thetvdb.com and www.otr-serien.de). onlineTVrecorder (OTR) is the free video recorder on the Internet that records almost all broadcasts from around 100 TV stations in Germany, USA, UK and other countries around the clock."
description_enu="SynOTR provides a workflow for TV recordings from onlineTVrecorder (OTR / https://onlinetvrecorder.com) for Synology NAS. synOTR performs *decoding *AC3-muxing (BETA) *cutting *MP4 conversion and *renaming (including Series information from www.thetvdb.com and www.otr-serien.de). onlineTVrecorder (OTR) is the free video recorder on the Internet that records almost all broadcasts from around 100 TV stations in Germany, USA, UK and other countries around the clock."
description_ger="SynOTR liefert einen Workflow für TV-Aufnahmen von onlineTVrecorder (OTR / https://onlinetvrecorder.com) auf Synology NAS. synOTR übernimmt *decodieren *AC3-muxing (BETA) *schneiden *MP4-Konvertierung und *umbenennung (inkl. Serieninformationen von www.thetvdb.com und www.otr-serien.de). onlineTVrecorder (OTR) ist der freie Videorecorder im Internet, der rund um die Uhr fast alle Sendungen von rund 100 TV-Sender aus Deutschland, USA, UK und anderen Lädern aufnimmt."
description="SynOTR liefert einen Workflow für TV-Aufnahmen von onlineTVrecorder (OTR) auf Synology NAS. synOTR übernimmt *decodieren *AC3-muxing (BETA) *schneiden *MP4-Konvertierung und *umbenennung (inkl. Serieninformationen von www.thetvdb.com und www.otr-serien.de). onlineTVrecorder (OTR) ist der freie Videorecorder im Internet, der rund um die Uhr fast alle Sendungen von rund 100 TV-Sender aus Deutschland, USA, UK und anderen Lädern aufnimmt."
maintainer="geimist"
admin_port=""
arch="noarch"
firmware="6.0-7321"
startable="yes"
reloadui="yes"
silent_install="yes"
silent_install="no"
silent_upgrade="yes"
silent_uninstall="no"
dsmappname=SYNO.SDS.synOTR.Application

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View file

@ -3,7 +3,8 @@
"step_title" : "Wichtiger Hinweis bei einem Upgrade!",
"items" : [
{
"desc" : "<p>Aufgrund eines Problems im DiskStationManager kann synOTR nach einem Upgrade nicht geöffnet werden. Daher <u>ist es nach einem Upgrage notwenig die DSM-Seite zu aktualisieren / neuzuladen (F5)</u> oder synOTR in einem neuen Fenster zu öffnen.</p>"
"desc" : "<p>Aufgrund eines Problems im DiskStationManager kann synOTR nach einem Upgrade nicht geöffnet werden. Daher <u>ist es nach einem Upgrage notwenig die DSM-Seite zu aktualisieren / neuzuladen (F5)</u> oder synOTR in einem neuen Fenster zu öffnen.</p><br>
<p>Eine Neuinstallation sollte davon nicht betroffen sein.</p>"
}
]
}

View file

@ -3,7 +3,7 @@
# Scriptaufruf:
#----------------------------------------------------------------------------------------
# erstellt das SPK aus dem aktuellen master-branch vom Server:
# sh ./build_spk.sh
# sh ./build_spk.sh
#
# erstellt das SPK aus dem als Parameter übergebenen Release vom Server:
# sh ./build_spk.sh 4.0.7
@ -11,133 +11,141 @@
#----------------------------------------------------------------------------------------
# Ordnerstruktur:
#----------------------------------------------------------------------------------------
# ./APP / Build --> Arbeitsumgebung (erstellen/editieren/verschieben)
# ./PKG / Pack --> Archivordner zum Aufbau des SPK (Startscripte etc.)
# ./[NAME-DES-SPK]/Build --> Arbeitsumgebung (erstellen/editieren/verschieben)
# ./[NAME-DES-SPK]/Pack --> Archivordner zum Aufbau des SPK (Startscripte etc.)
#
set -euo pipefail
IFS=$'\n\t'
build_tmp=$(mktemp -d -t tmp.XXXXXXXXXX)
function finish {
git worktree remove --force "$build_tmp"
rm -rf "$build_tmp"
}
trap finish EXIT
#######
project="synOTR"
#######
if ! [ -x "$(command -v git)" ]; then
echo 'Error: git is not installed.' >&2
exit 1
skriptuser=`whoami`
if [ ${skriptuser} != "root" ]; then
echo "Dieses Skript muss von Root ausgeführt werden!"
exit 1
fi
if ! [ -x "$(command -v fakeroot)" ]; then
if [ $(whoami) != "root" ]; then
echo "WARNUNG: fakeroot ist nicht installiert und du bist auch nicht root!" >&2
exit 1
else
FAKEROOT=""
fi
else
FAKEROOT=$(command -v fakeroot)
gitpath=`which git`
if [ -z ${gitpath} ]; then
echo "Das Programm git konnte nicht gefunden werden."
exit 1
fi
# Arbeitsverzeichnis auslesen und hineinwechseln:
# ---------------------------------------------------------------------
# shellcheck disable=SC2086
APPDIR=$(cd "$(dirname $0)";pwd)
cd "${APPDIR}"
APPDIR=$(cd $(dirname $0);pwd)
cd ${APPDIR}
git pull # aktualisieren
build_tmp="${APPDIR}/build_tmp"
dir=${APPDIR}
buildversion=${1:-latest}
taggedversions=$(git tag)
# Ausführung: Erstellen des SPK
echo ""
echo "-----------------------------------------------------------------------------------"
echo " git holt die aktuelle Version ..."
echo "-----------------------------------------------------------------------------------"
echo " - INFO: Erstelle den temporären Buildordner und kopiere Sourcen hinein ..."
git worktree add --force "$build_tmp" "$(git rev-parse --abbrev-ref HEAD)"
pushd "$build_tmp"
#set_spk_version="latest-$(date +%s)-$(git log -1 --format="%h")"
set_spk_version="$(git branch --show-current)_latest_($(date +%Y)-$(date +%m)-$(date +%d)_$(date +%H)-$(date +%M))_$(git log -1 --format="%h")"
if echo "$taggedversions" | egrep -q "$buildversion"; then
echo "git checkout zu $buildversion"
git checkout "$buildversion"
set_spk_version="$buildversion"
if [ -d "./${project}" ] ; then
cd ${project}
git pull
versions=`git tag`
branches=`git branch -a`
cd ${APPDIR}
else
echo "ACHTUNG: Die gewünschte Version wurde im Repository nicht gefunden!"
echo "Die $(git rev-parse --abbrev-ref HEAD)-branch wird verwendet!"
git clone https://geimist.eu:30443/geimist/${project}.git
cd ${project}
versions=`git tag`
branches=`git branch -a`
cd ${APPDIR}
fi
# fallback to old app dir
if [ -d "$build_tmp"/Build ]; then
APP=Build
# welche Version soll gebaut werden:
if [ -z $1 ]; then # wurde keine gewünschte Version angegeben:
echo "git checkout zu master-branch"
cd ${project}
git checkout master
cd ${APPDIR}
# build_version=`cat "${APPDIR}/${project}/Pack/INFO" | grep version | awk -F '"' '{print $2}'`
build_version=`get_key_value "${APPDIR}/${project}/Pack/INFO" version`
set_spk_version="latest_(`date +%Y`-`date +%m`-`date +%d`_`date +%H`-`date +%M`)"
else
APP=APP
if echo "$versions" | egrep -q "$1" || echo "$branches" | egrep -q "$1"; then # wurde eine gewünschte Version angegeben:
echo "git checkout zu $1"
cd ${project}
git checkout "$1"
set_spk_version="v${1}"
cd ${APPDIR}
build_version=`get_key_value "${APPDIR}/${project}/Pack/INFO" version`
else # ist die gewünschte Version nicht vorhanden:
echo "ACHTUNG: Die gewünschte Version wurde im Repository nicht gefunden!"
echo "Der master-branch wird verwendet!"
cd ${project}
git checkout master
cd ${APPDIR}
build_version=`get_key_value "${APPDIR}/${project}/Pack/INFO" version`
set_spk_version="latest_v${build_version}_(`date +%Y`-`date +%m`-`date +%d`_`date +%H`-`date +%M`)"
fi
fi
# fallback to old pkg dir
if [ -d "$build_tmp"/Pack ]; then
PKG=Pack
else
PKG=PKG
fi
build_version=$(grep version "$build_tmp/$PKG/INFO" | awk -F '"' '{print $2}')
#set_spk_version=$build_version
echo " - INFO: Es wird foldende Version geladen und gebaut: $set_spk_version - BUILD-Version (INFO-File): $build_version"
echo " - INFO: Erstelle den temporären Buildordner und kopiere Sourcen hinein ..."
if [ -d "./build_tmp" ] ; then
rm -rf "./build_tmp"
fi
mkdir "${build_tmp}"
cp -r "${APPDIR}/${project}"/* "${build_tmp}/"
# Ausführung: Erstellen des SPK
echo ""
echo "-----------------------------------------------------------------------------------"
echo " SPK wird erstellt..."
echo "-----------------------------------------------------------------------------------"
echo ""
echo "-----------------------------------------------------------------------------------"
echo " SPK wird erstellt..."
echo "-----------------------------------------------------------------------------------"
# Falls versteckter Ordners /.helptoc vorhanden, diesen nach /helptoc umbenennen
if test -d "${build_tmp}/.helptoc"; then
echo ""
echo " - INFO: Versteckter Ordner /.helptoc wurde lokalisiert und nach /helptoc umbenannt"
mv "${build_tmp}/.helptoc" "${build_tmp}/helptoc"
fi
if test -d "${build_tmp}/.helptoc"; then
echo ""
echo " - INFO: Versteckter Ordner /.helptoc wurde lokalisiert und nach /helptoc umbenannt"
mv ${build_tmp}/.helptoc ${build_tmp}/helptoc
fi
# Rechte anpassen
echo ""
echo " - INFO: Dateirechte anpassen ..."
for i in $(find "${build_tmp}/$APP/" -type f)
for i in $(find "${build_tmp}/Pack/" -type f)
do
# echo "ändere $APP: $i"
chmod 755 "$i"
chown root:root "$i"
done
for i in $(find "${build_tmp}/$PKG/" -type f)
for i in $(find "${build_tmp}/Build/" -type f)
do
# echo "ändere $PKG: $i"
chmod 755 "$i"
chown root:root "$i"
done
# Packen und Ablegen der aktuellen Installation in den entsprechenden /Pack - Ordner
echo ""
echo " - INFO: Das Archiv package.tgz wird erstellt..."
$FAKEROOT tar -C "${build_tmp}"/"$APP" -czf "${build_tmp}"/"$PKG"/package.tgz .
echo ""
echo " - INFO: Das Archiv package.tgz wird erstellt..."
tar -C ${build_tmp}/Build -czf ${build_tmp}/Pack/package.tgz .
# Wechsel in den Ablageort von package.tgz bezüglich Aufbau des SPK's
cd "${build_tmp}"/"$PKG"
cd ${build_tmp}/Pack
# Erstellen des eigentlichen SPK's
echo ""
echo " - INFO: Das SPK wird erstellt..."
$FAKEROOT tar -cf "${project}"_"$set_spk_version".spk *
cp -f "${project}"_"$set_spk_version".spk "${APPDIR}"
echo ""
echo " - INFO: Das SPK wird erstellt..."
tar -cf ${project}_$set_spk_version.spk *
mv ${project}_$set_spk_version.spk ${APPDIR}
# Löschen der temporären Daten
echo ""
echo " - INFO: Der temporäre Ordner wird wieder geschlöscht ..."
cd ${APPDIR}
if [ -d "./build_tmp" ] ; then
rm -rf "./build_tmp"
fi
echo ""
echo "-----------------------------------------------------------------------------------"

View file

@ -1,178 +0,0 @@
#!/bin/bash
#----------------------------------------------------------------------------------------
# Scriptaufruf:
#----------------------------------------------------------------------------------------
# erstellt das SPK aus dem aktuellen master-branch vom Server:
# sh ./build_spk.sh
#
# erstellt das SPK aus dem als Parameter übergebenen Release vom Server:
# sh ./build_spk.sh 4.0.7
#
#----------------------------------------------------------------------------------------
# Ordnerstruktur:
#----------------------------------------------------------------------------------------
# ./[NAME-DES-SPK]/Build --> Arbeitsumgebung (erstellen/editieren/verschieben)
# ./[NAME-DES-SPK]/Pack --> Archivordner zum Aufbau des SPK (Startscripte etc.)
#
project="synOTR"
skriptuser=`whoami`
if [ ${skriptuser} != "root" ]; then
echo "Dieses Skript muss von Root ausgeführt werden!"
exit 1
fi
# Arbeitsverzeichnis auslesen und hineinwechseln:
# ---------------------------------------------------------------------
APPDIR=$(cd $(dirname $0);pwd)
cd ${APPDIR}
build_tmp="${APPDIR}/build_tmp"
dir=${APPDIR}
buildversion=$1
if [ -d "./${project}" ] ; then
rm -rf "./${project}"
fi
gitpull()
{
gitpath=`which git`
if [ -z ${gitpath} ]; then
echo "Das Programm git konnte nicht gefunden werden."
exit 1
fi
# Ausführung: Erstellen des SPK
echo ""
echo "-----------------------------------------------------------------------------------"
echo " git holt die aktuelle Version ..."
echo "-----------------------------------------------------------------------------------"
if [ -d "./${project}" ] ; then
cd ${project}
git pull
versions=`git tag`
cd ${APPDIR}
else
git clone https://geimist.eu:30443/geimist/${project}.git
cd ${project}
git pull
versions=`git tag`
cd ${APPDIR}
fi
#build_version=`cat "${APPDIR}/${project}/Pack/INFO" | grep version | awk -F '"' '{print $2}'`
# welche Version soll gebaut werden:
if [ -z $buildversion ]; then
echo "git checkout zu master-branch"
cd ${project}
git checkout master
cd ${APPDIR}
set_spk_version="latest_(`date +%Y`-`date +%m`-`date +%d`_`date +%H`-`date +%M`)"
else
if echo "$versions" | egrep -q "$buildversion"; then
echo "git checkout zu $buildversion"
cd ${project}
git checkout "$buildversion"
set_spk_version="$buildversion"
cd ${APPDIR}
else
echo "ACHTUNG: Die gewünschte Version wurde im Repository nicht gefunden!"
echo "Der master-branch wird verwendet!"
cd ${project}
git checkout master
cd ${APPDIR}
set_spk_version="latest_(`date +%Y`-`date +%m`-`date +%d`_`date +%H`-`date +%M`)"
fi
fi
}
gitpull
build_version=$(get_key_value "${APPDIR}/${project}/Pack/INFO" version )
echo " - INFO: Es wird foldende Version geladen und gebaut: $set_spk_version - BUILD-Version (INFO-File): $build_version"
echo " - INFO: Erstelle den temporären Buildordner und kopiere Sourcen hinein ..."
if [ -d "./build_tmp" ] ; then
rm -rf "./build_tmp"
fi
mkdir "${build_tmp}"
cp -r "${APPDIR}/${project}"/* "${build_tmp}/"
# Ausführung: Erstellen des SPK
echo ""
echo "-----------------------------------------------------------------------------------"
echo " SPK wird erstellt..."
echo "-----------------------------------------------------------------------------------"
# Falls versteckter Ordners /.helptoc vorhanden, diesen nach /helptoc umbenennen
if test -d "${build_tmp}/.helptoc"; then
echo ""
echo " - INFO: Versteckter Ordner /.helptoc wurde lokalisiert und nach /helptoc umbenannt"
mv ${build_tmp}/.helptoc ${build_tmp}/helptoc
fi
# Rechte anpassen
echo ""
echo " - INFO: Dateirechte anpassen ..."
for i in $(find "${build_tmp}/Pack/" -type f)
do
# echo "ändere Pack: $i"
chmod 755 "$i"
chown root:root "$i"
done
for i in $(find "${build_tmp}/Build/" -type f)
do
# echo "ändere Build: $i"
chmod 755 "$i"
chown root:root "$i"
done
# Packen und Ablegen der aktuellen Installation in den entsprechenden /Pack - Ordner
echo ""
echo " - INFO: Das Archiv package.tgz wird erstellt..."
tar -C ${build_tmp}/Build -czf ${build_tmp}/Pack/package.tgz .
# Wechsel in den Ablageort von package.tgz bezüglich Aufbau des SPK's
cd ${build_tmp}/Pack
# Erstellen des eigentlichen SPK's
echo ""
echo " - INFO: Das SPK wird erstellt..."
tar -cf ${project}_$set_spk_version.spk *
mv ${project}_$set_spk_version.spk ${APPDIR}
# Löschen der temporären Daten
echo ""
echo " - INFO: Der temporäre Ordner wird wieder geschlöscht ..."
cd ${APPDIR}
if [ -d "./build_tmp" ] ; then
rm -rf "./build_tmp"
fi
echo ""
echo "-----------------------------------------------------------------------------------"
echo " Das SPK wurde erstellt und befindet sich unter..."
echo "-----------------------------------------------------------------------------------"
echo ""
echo " ${APPDIR}/${project}_$set_spk_version.spk"
echo ""
exit 0