From a4ba2f08556a2e300797ce616ab738a3e455e466 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Mon, 20 Apr 2020 13:39:43 -0400 Subject: [PATCH 01/11] Use SMA config file, instead of parameters --- root/etc/cont-init.d/32-sma-setup.bash | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/root/etc/cont-init.d/32-sma-setup.bash b/root/etc/cont-init.d/32-sma-setup.bash index f5b03a9..d32b1fb 100644 --- a/root/etc/cont-init.d/32-sma-setup.bash +++ b/root/etc/cont-init.d/32-sma-setup.bash @@ -18,15 +18,16 @@ if [ ! -d "/config/scripts/logs" ]; then fi # import new config, if does not exist -if [ ! -f "/config/sma/autoProcess.ini" ]; then - cp "/usr/local/sma/setup/autoProcess.ini.sample" "/usr/local/sma/config/autoProcess.ini" +if [ ! -f "/config/scripts/configs/autoProcess.ini" ]; then + cp "/usr/local/sma/setup/autoProcess.ini.sample" "/config/scripts/configs/autoProcess.ini" fi # create sma log file touch "/config/scripts/logs/sma.log" && \ -# link sma log file +# link sma files ln -s "/config/scripts/logs/sma.log" "/usr/local/sma/config/sma.log" && \ +ln -s "/config/scripts/configs/autoProcess.ini" "/usr/local/sma/config/autoProcess.ini" && \ # set permissions chmod 0666 "/config/scripts/logs"/* From 71d5eef92a30b4c9328f45e3fb63dd47e663e0c0 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Mon, 20 Apr 2020 13:42:50 -0400 Subject: [PATCH 02/11] Change file/path location of autoProcess.ini" --- root/scripts/update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/scripts/update.py b/root/scripts/update.py index 9d114a5..89a357e 100644 --- a/root/scripts/update.py +++ b/root/scripts/update.py @@ -6,7 +6,7 @@ import logging import configparser import xml.etree.ElementTree as ET -autoProcess = os.path.join(os.environ.get("SMA_PATH", "/usr/local/sma"), "config/autoProcess.ini") +autoProcess = "/config/scripts/configs/autoProcess.ini" def main(): From 79bb45c9a2d67556e3e9c9f4bd713d1da6df35ba Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Mon, 20 Apr 2020 14:12:07 -0400 Subject: [PATCH 03/11] Update 32-sma-setup.bash --- root/etc/cont-init.d/32-sma-setup.bash | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/root/etc/cont-init.d/32-sma-setup.bash b/root/etc/cont-init.d/32-sma-setup.bash index d32b1fb..23d71b3 100644 --- a/root/etc/cont-init.d/32-sma-setup.bash +++ b/root/etc/cont-init.d/32-sma-setup.bash @@ -11,12 +11,18 @@ if [ -d "/usr/local/sma/config" ]; then sleep 0.1 fi -# create config directory +# create logs directory if [ ! -d "/config/scripts/logs" ]; then mkdir -p "/config/scripts/logs" && \ chmod 0777 -R "/config/scripts/logs" fi +# create config directory +if [ ! -d "/config/scripts/configs" ]; then + mkdir -p "/config/scripts/configs" && \ + chmod 0777 -R "/config/scripts/configs" +fi + # import new config, if does not exist if [ ! -f "/config/scripts/configs/autoProcess.ini" ]; then cp "/usr/local/sma/setup/autoProcess.ini.sample" "/config/scripts/configs/autoProcess.ini" From 5bc701e7fc0e76617880d51057cb1bbf33171e1b Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Mon, 20 Apr 2020 14:17:55 -0400 Subject: [PATCH 04/11] Using manul SMA config file to simplify maintenance --- README.md | 68 +++++-------------------------------------------------- 1 file changed, 6 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 8fb3b6a..43ae3b9 100644 --- a/README.md +++ b/README.md @@ -43,65 +43,7 @@ Container images are configured using parameters passed at runtime (such as thos | `-e AUDIO_BEETSTAGGING=TRUE` | TRUE = ENABLED, use beets to tag files | | `-e AUDIO_REQUIREBEETSTAGGING=false` | true = enabled :: skips importing files that could not be matched using beets (marks as failed) | | `-e VIDEO_LANG=eng` | Default: eng :: Set to required language (ISO 639-2 language code), if not found, will mark as failed | -| `-e VIDEO_SMA=FALSE` | TRUE = Enabled :: Uses SMA to process incoming video files, update your configuraiton at: /config/scripts/configs/(radarr/sonarr)-pp.ini | -| `-e CONVERTER_THREADS="0"` | FFMpeg threads, corresponds to threads parameter | -| `-e CONVERTER_HWACCELS=""` | Approved FFmpeg hardware accelerator encoders: hwaccels | -| `-e CONVERTER_HWACCEL_DECODERS=""` | Approved FFmpeg hardware decoders | -| `-e CONVERTER_OUTPUT_FORMAT="mkv"` | Wrapped format corresponding to -f in FFmpeg | -| `-e CONVERTER_OUTPUT_EXTENSION="mkv"` | File extension for created media | -| `-e CONVERTER_SORT_STREAMS="True"` | Sort streams by language preferences and channels | -| `-e CONVERTER_PROCESS_SAME_EXTENSIONS="False"` | Run files with the same input and output extensions through the conversion process. Tagging is not effected. If after options are generated all streams are copy conversion will be skipped. Use with caution alongside universal audio and audio copy-original as tracks will keep replicating | -| `-e CONVERTER_FORCE_CONVERT="False"` | Force conversion regardless of streams being in appropriate format | -| `-e CONVERTER_PREOPTS=""` | Additional comma separated FFmpeg options placed before main commands | -| `-e CONVERTER_POSTOPTS=""` | Additional comma separated FFmpeg options placed after main commands | -| `-e PERMISSIONS_CHMOD="0666"` | Base 8 chmod value | -| `-e METADATA_RELOCATE_MOV="FALSE"` | Relocate MOOV atom using QTFastStart. MP4 only | -| `-e METADATA_TAG="False"` | Tag files with metadata from TMDB. MP4 only | -| `-e METADATA_TAG_LANGUAGE="eng"` | Tag language | -| `-e METADATA_DOWNLOAD_ARTWORK="thumb"` | Download artwork and embed in media. poster, thumb, True, False are valid options | -| `-e METADATA_PRESERVE_SOURCE_DISPOSITION="False"` | Maintain disposition elements from source file, set False to have the script set defaults based on sorting and preferences | -| `-e VIDEO_CODEC="h264, x264"` | Approved video codecs. Codecs not on this list are converted to the first codec on the list | -| `-e VIDEO_BITRATE="0"` | Maximum bitrate for video in Kb. Values above this range will be down sampled. 0 for no limit | -| `-e VIDEO_CRF="-1"` | CRF value, -1 to disable | -| `-e VIDEO_CRF_PROFILES=""` | See script website: https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/AutoProcess-Settings | -| `-e VIDEO_MAX_WIDTH="0"` | Maximum video width, videos larger will be down sized | -| `-e VIDEO_PROFILE=""` | Video profile | -| `-e VIDEO_MAX_LEVEL="4.1"` | Maximum video level, videos above will be down sampled. Format example is 4.1 | -| `-e VIDEO_PIX_FMT=""` | Supported pix-fmt list. Formats not on this list are be converted to the first format on the list | -| `-e AUDIO_CODEC="ac3, eac3, aac, mp3, opus"` | Approved audio codecs. Codecs not on this list are converted to the first codec on the list | -| `-e AUDIO_LANGUAGES="eng"` | Approved audio stream languages. Languages not on this list will not be used. Leave blank to approve all languages | -| `-e AUDIO_DEFAULT_LANGUAGE="eng"` | If audio stream language is undefined, assumed this language | -| `-e AUDIO_FIRST_STREAM_OF_LANGUAGE="False"` | Only include the first occurrence of an audio stream of language | -| `-e AUDIO_CHANNEL_BITRATE="64"` | Bitrate of audio stream per channel. Multiple by number of channels to get stream bitrate. Use 0 to attempt to guess based on source bitrate | -| `-e AUDIO_MAX_BITRATE="0"` | Maximum audio stream bitrate regardless of channels. 0 for no limit | -| `-e AUDIO_MAX_CHANNELS="0"` | Maximum number of audio channels per stream. Streams with more channels will be down sampled | -| `-e AUDIO_PREFER_MORE_CHANNELS="True"` | When sorting source audio streams, prefer higher channel counts | -| `-e AUDIO_DEFAULT_MORE_CHANNELS="True"` | When setting default audio stream, prefer higher channel counts | -| `-e AUDIO_FILTER=""` | FFmpeg audio filter. Setting this will not allow copying audio streams | -| `-e AUDIO_SAMPLE_RATES=""` | Approved audio sample rates, rates not on the approved list will be converted to the first rate on the list | -| `-e AUDIO_COPY_ORIGINAL="True"` | Always include a copy of the original audio stream | -| `-e AUDIO_AAC_ADTSTOASC="False"` | | -| `-e AUDIO_IGNORE_TREHD="mp4, m4v"` | Ignore trueHD audio streams for specific extensions (Not supported in MP4 containers). Leave blank to disable | -| `-e UAUDIO_CODEC="aac, mp3"` | Approved audio codecs. Codecs not on this list are converted to the first codec on the list | -| `-e UAUDIO_CHANNEL_BITRATE="80"` | Bitrate of universal audio stream per channel. Multiple by number of channels to get stream bitrate. Use 0 to attempt to guess based on source bitrate | -| `-e UAUDIO_FIRST_STREAM_ONLY="True"` | Only create a universal audio stream for the first audio stream encountered | -| `-e UAUDIO_MOVE_AFTER="True"` | Move universal audio stream after the source stream | -| `-e UAUDIO_FILTER=""` | FFmpeg audio filter. Setting this will not allow copying audio streams | -| `-e SUBTITLE_CODEC="srt"` | Approved subtitle codecs. Codecs not on this list are converted to the first codec on the list | -| `-e SUBTITLE_CODEC_IMAGE_BASED=""` | Approved image-based subtitle codecs. Codecs not on this list are converted to the first codec on the list | -| `-e SUBTITLE_LANGUAGES="eng"` | Approved subtitle stream languages. Languages not on this list will not be used. Leave blank to approve all languages | -| `-e SUBTITLE_DEFAULT_LANGUAGE="eng"` | If subtitle stream language is undefined, assumed this language | -| `-e SUBTITLE_FIRST_STREAM_OF_LANGUAGE="False"` | Only include the first occurrence of a subtitle stream of language | -| `-e SUBTITLE_ENCODING=""` | Subtitle encoding format | -| `-e SUBTITLE_BURN_SUBTITLES="False"` | Burns subtitles onto video stream. Valid parameters are true / any, false, default, forced, default, forced. If a valid subtitle for burning is found this will force the video stream to be encoded (cannot copy). Internal subtitles are prioritized over external subtitles. This feature does not support image based subtitle formats | -| `-e SUBTITLE_DOWNLOAD_SUBS="False"` | Attempt to download subtitles of your specified languages automatically using subliminal | -| `-e SUBTITLE_DOWNLOAD_HEARING_IMPAIRED_SUBS="False"` | Download hearing impaired subtitles using subliminal | -| `-e SUBTITLE_DOWNLOAD_PROVIDERS=""` | Subliminal providers, leave blank to use default providers | -| `-e SUBTITLE_EMBED_SUBS="True"` | Embeds text based subtitles in the output video. External subtitles in the same directory will embedded. If false subtitles will be extracted | -| `-e SUBTITLE_EMBED_IMAGE_SUBS="False"` | Embed image based subtitles in the output video. Ensure you are using a container that supports image based subtitles | -| `-e SUBTITLE_EMBED_ONLY_INTERNAL_SUBS="False"` | Limit embedding subtitles to only subs embedded in the source file | -| `-e SUBTITLE_IGNORE_EMBEDDED_SUBS="True"` | Ignore sub streams included in source file, external sources will still be processed | -| `-e SUBTITLE_ATTACHMENT_CODEC=""` | Approved codecs for attachments. Useful for fonts included with source file | +| `-e VIDEO_SMA=FALSE` | TRUE = Enabled :: Uses SMA to process incoming video files, update your configuraiton at: /config/scripts/configs/autoProcess.ini | ## Application Setup @@ -125,9 +67,11 @@ Access the webui at `:8080`, for more information check out [SABnzbd](h beets-config.yaml :: Beet config file for matching

Scripts are hosted here: https://github.com/RandomNinjaAtk/sabnzbd-scripts ### Sickbeard MP4 Automater (SMA): -Configuration handled by ENV variables, see parameters
+Config Files Location: /config/scritps/configs
+* autoProcess.ini :: config file for SMA + Log Files Location: /config/scritps/logs
-sma.log :: Log file for SMA
+* sma.log :: Log file for SMA For more detailed configuration info, visit: https://github.com/mdhiggins/sickbeard_mp4_automator

### Hardware Acceleration: -1. Set the `-e VIDEO_CODEC` to: `h264vaapi` (h254) or `h265vaapi` (h265) +1. Set the video codec in SMA config file to: `h264vaapi` (h254) or `h265vaapi` (h265) From 475ceb6457cece4714f163df83815a8dd916b6fa Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Mon, 20 Apr 2020 14:19:23 -0400 Subject: [PATCH 05/11] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 43ae3b9..be35424 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ Access the webui at `:8080`, for more information check out [SABnzbd](h /config :: Location of SABnzbd aplication files
/config/scripts :: Location of SABnzbd post process script files (automatically mapped in SABnzbd)
/config/scripts/logs :: Location of SMA log files
+/config/scritps/configs :: Location of SMA config file
### Important SABNzbd Categories: lidarr :: Automatically configured to post process using audio-pp.bash
radarr :: Automatically configured to post process using video-pp.bash
From d86e8c417e102683c77c431d4b7249bae0d5b340 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Mon, 20 Apr 2020 14:21:52 -0400 Subject: [PATCH 06/11] Remove options --- root/scripts/update.py | 186 +---------------------------------------- 1 file changed, 1 insertion(+), 185 deletions(-) diff --git a/root/scripts/update.py b/root/scripts/update.py index 89a357e..6abc64d 100644 --- a/root/scripts/update.py +++ b/root/scripts/update.py @@ -16,191 +16,7 @@ def main(): # Set Converter Settings safeConfigParser.set("Converter", "ffmpeg", "ffmpeg") safeConfigParser.set("Converter", "ffprobe", "ffprobe") - if os.environ.get("CONVERTER_THREADS"): - safeConfigParser.set("Converter", "threads", os.environ.get("CONVERTER_THREADS")) - if os.environ.get("CONVERTER_HWACCELS"): - safeConfigParser.set("Converter", "hwaccels", os.environ.get("CONVERTER_HWACCELS")) - else: - safeConfigParser.set("Converter", "hwaccels", " ") - if os.environ.get("CONVERTER_HWACCEL_DECODERS"): - safeConfigParser.set("Converter", "hwaccel-decoders", os.environ.get("CONVERTER_HWACCEL_DECODERS")) - else: - safeConfigParser.set("Converter", "hwaccel-decoders", " ") - if os.environ.get("CONVERTER_OUTPUT_FORMAT"): - safeConfigParser.set("Converter", "output-format", os.environ.get("CONVERTER_OUTPUT_FORMAT")) - if os.environ.get("CONVERTER_OUTPUT_EXTENSION"): - safeConfigParser.set("Converter", "output-extension", os.environ.get("CONVERTER_OUTPUT_EXTENSION")) - if os.environ.get("CONVERTER_MINIMUM_SIZE"): - safeConfigParser.set("Converter", "minimum-size", os.environ.get("CONVERTER_MINIMUM_SIZE")) - if os.environ.get("CONVERTER_SORT_STREAMS"): - safeConfigParser.set("Converter", "sort-streams", os.environ.get("CONVERTER_SORT_STREAMS")) - if os.environ.get("CONVERTER_PROCESS_SAME_EXTENSIONS"): - safeConfigParser.set("Converter", "process-same-extensions", os.environ.get("CONVERTER_PROCESS_SAME_EXTENSIONS")) - if os.environ.get("CONVERTER_FORCE_CONVERT"): - safeConfigParser.set("Converter", "force-convert", os.environ.get("CONVERTER_FORCE_CONVERT")) - if os.environ.get("CONVERTER_PREOPTS"): - safeConfigParser.set("Converter", "preopts", os.environ.get("CONVERTER_PREOPTS")) - else: - safeConfigParser.set("Converter", "preopts", " ") - if os.environ.get("CONVERTER_POSTOPTS"): - safeConfigParser.set("Converter", "postopts", os.environ.get("CONVERTER_POSTOPTS")) - else: - safeConfigParser.set("Converter", "postopts", " ") - - # SET Permissions - if os.environ.get("PERMISSIONS_CHMOD"): - safeConfigParser.set("Permissions", "chmod", os.environ.get("PERMISSIONS_CHMOD")) - - # Set Metadata Settings - if os.environ.get("METADATA_RELOCATE_MOV"): - safeConfigParser.set("Metadata", "relocate-moov", os.environ.get("METADATA_RELOCATE_MOV")) - if os.environ.get("METADATA_TAG"): - safeConfigParser.set("Metadata", "tag", os.environ.get("METADATA_TAG")) - if os.environ.get("METADATA_TAG_LANGUAGE"): - safeConfigParser.set("Metadata", "tag-language", os.environ.get("METADATA_TAG_LANGUAGE")) - if os.environ.get("METADATA_DOWNLOAD_ARTWORK"): - safeConfigParser.set("Metadata", "download-artwork", os.environ.get("METADATA_DOWNLOAD_ARTWORK")) - if os.environ.get("METADATA_SANITIZE_DISPOSITION"): - safeConfigParser.set("Metadata", "sanitize-disposition", os.environ.get("METADATA_SANITIZE_DISPOSITION")) - - # Set Video Settings - if os.environ.get("VIDEO_CODEC"): - safeConfigParser.set("Video", "codec", os.environ.get("VIDEO_CODEC")) - if os.environ.get("VIDEO_MAX_BITRATE"): - safeConfigParser.set("Video", "max-bitrate", os.environ.get("VIDEO_MAX_BITRATE")) - if os.environ.get("VIDEO_CRF"): - safeConfigParser.set("Video", "crf", os.environ.get("VIDEO_CRF")) - if os.environ.get("VIDEO_CRF_PROFILES"): - safeConfigParser.set("Video", "crf-profiles", os.environ.get("VIDEO_CRF_PROFILES")) - else: - safeConfigParser.set("Video", "crf-profiles", " ") - if os.environ.get("VIDEO_MAX_WIDTH"): - safeConfigParser.set("Video", "max-width", os.environ.get("VIDEO_MAX_WIDTH")) - if os.environ.get("VIDEO_PROFILE"): - safeConfigParser.set("Video", "profile", os.environ.get("VIDEO_PROFILE")) - else: - safeConfigParser.set("Video", "profile", " ") - if os.environ.get("VIDEO_MAX_LEVEL"): - safeConfigParser.set("Video", "max-level", os.environ.get("VIDEO_MAX_LEVEL")) - if os.environ.get("VIDEO_PIX_FMT"): - safeConfigParser.set("Video", "pix-fmt", os.environ.get("VIDEO_PIX_FMT")) - else: - safeConfigParser.set("Video", "pix-fmt", " ") - - # Set Audio Settings - if os.environ.get("AUDIO_CODEC"): - safeConfigParser.set("Audio", "codec", os.environ.get("AUDIO_CODEC")) - if os.environ.get("AUDIO_LANGUAGES"): - safeConfigParser.set("Audio", "languages", os.environ.get("AUDIO_LANGUAGES")) - else: - safeConfigParser.set("Audio", "languages", " ") - if os.environ.get("AUDIO_DEFAULT_LANGUAGE"): - safeConfigParser.set("Audio", "default-language", os.environ.get("AUDIO_DEFAULT_LANGUAGE")) - else: - safeConfigParser.set("Audio", "default-language", " ") - if os.environ.get("AUDIO_FIRST_STREAM_OF_LANGUAGE"): - safeConfigParser.set("Audio", "first-stream-of-language", os.environ.get("AUDIO_FIRST_STREAM_OF_LANGUAGE")) - if os.environ.get("AUDIO_CHANNEL_BITRATE"): - safeConfigParser.set("Audio", "channel-bitrate", os.environ.get("AUDIO_CHANNEL_BITRATE")) - if os.environ.get("AUDIO_MAX_BITRATE"): - safeConfigParser.set("Audio", "max-bitrate", os.environ.get("AUDIO_MAX_BITRATE")) - if os.environ.get("AUDIO_MAX_CHANNELS"): - safeConfigParser.set("Audio", "max-channels", os.environ.get("AUDIO_MAX_CHANNELS")) - if os.environ.get("AUDIO_PREFER_MORE_CHANNELS"): - safeConfigParser.set("Audio", "prefer-more-channels", os.environ.get("AUDIO_PREFER_MORE_CHANNELS")) - if os.environ.get("AUDIO_DEFAULT_MORE_CHANNELS"): - safeConfigParser.set("Audio", "default-more-channels", os.environ.get("AUDIO_DEFAULT_MORE_CHANNELS")) - if os.environ.get("AUDIO_FILTER"): - safeConfigParser.set("Audio", "filter", os.environ.get("AUDIO_FILTER")) - else: - safeConfigParser.set("Audio", "filter", " ") - if os.environ.get("AUDIO_SAMPLE_RATES"): - safeConfigParser.set("Audio", "sample-rates", os.environ.get("AUDIO_SAMPLE_RATES")) - else: - safeConfigParser.set("Audio", "sample-rates", " ") - if os.environ.get("AUDIO_COPY_ORIGINAL"): - safeConfigParser.set("Audio", "copy-original", os.environ.get("AUDIO_COPY_ORIGINAL")) - if os.environ.get("AUDIO_AAC_ADTSTOASC"): - safeConfigParser.set("Audio", "aac-adtstoasc", os.environ.get("AUDIO_AAC_ADTSTOASC")) - if os.environ.get("AUDIO_IGNORE_TREHD"): - safeConfigParser.set("Audio", "ignore-truehd", os.environ.get("AUDIO_IGNORE_TREHD")) - - # Set Universal Audio Settings - if os.environ.get("UAUDIO_CODEC"): - safeConfigParser.set("Universal Audio", "codec", os.environ.get("UAUDIO_CODEC")) - else: - safeConfigParser.set("Universal Audio", "codec", " ") - if os.environ.get("UAUDIO_CHANNEL_BITRATE"): - safeConfigParser.set("Universal Audio", "channel-bitrate", os.environ.get("UAUDIO_CHANNEL_BITRATE")) - if os.environ.get("UAUDIO_FIRST_STREAM_ONLY"): - safeConfigParser.set("Universal Audio", "first-stream-only", os.environ.get("UAUDIO_FIRST_STREAM_ONLY")) - if os.environ.get("UAUDIO_MOVE_AFTER"): - safeConfigParser.set("Universal Audio", "move-after", os.environ.get("UAUDIO_MOVE_AFTER")) - if os.environ.get("UAUDIO_FILTER"): - safeConfigParser.set("Universal Audio", "filter", os.environ.get("UAUDIO_FILTER")) - else: - safeConfigParser.set("Universal Audio", "filter", " ") - - # Set Subtitle Settings - if os.environ.get("SUBTITLE_CODEC"): - safeConfigParser.set("Subtitle", "codec", os.environ.get("SUBTITLE_CODEC")) - if os.environ.get("SUBTITLE_CODEC_IMAGE_BASED"): - safeConfigParser.set("Subtitle", "codec-image-based", os.environ.get("SUBTITLE_CODEC_IMAGE_BASED")) - else: - safeConfigParser.set("Subtitle", "codec-image-based", " ") - if os.environ.get("SUBTITLE_LANGUAGES"): - safeConfigParser.set("Subtitle", "languages", os.environ.get("SUBTITLE_LANGUAGES")) - else: - safeConfigParser.set("Subtitle", "languages", " ") - if os.environ.get("SUBTITLE_DEFAULT_LANGUAGE"): - safeConfigParser.set("Subtitle", "default-language", os.environ.get("SUBTITLE_DEFAULT_LANGUAGE")) - else: - safeConfigParser.set("Subtitle", "default-language", " ") - if os.environ.get("SUBTITLE_FIRST_STREAM_OF_LANGUAGE"): - safeConfigParser.set("Subtitle", "first-stream-of-language", os.environ.get("SUBTITLE_FIRST_STREAM_OF_LANGUAGE")) - if os.environ.get("SUBTITLE_ENCODING"): - safeConfigParser.set("Subtitle", "encoding", os.environ.get("SUBTITLE_ENCODING")) - else: - safeConfigParser.set("Subtitle", "encoding", " ") - if os.environ.get("SUBTITLE_BURN_SUBTITLES"): - safeConfigParser.set("Subtitle", "burn-subtitles", os.environ.get("SUBTITLE_BURN_SUBTITLES")) - if os.environ.get("SUBTITLE_BURN_DISPOSITIONS"): - safeConfigParser.set("Subtitle", "burn-dispositions", os.environ.get("SUBTITLE_BURN_DISPOSITIONS")) - else: - safeConfigParser.set("Subtitle", "burn-dispositions", " ") - if os.environ.get("SUBTITLE_DOWNLOAD_SUBS"): - safeConfigParser.set("Subtitle", "download-subs", os.environ.get("SUBTITLE_DOWNLOAD_SUBS")) - if os.environ.get("SUBTITLE_DOWNLOAD_HEARING_IMPAIRED_SUBS"): - safeConfigParser.set("Subtitle", "download-hearing-impaired-subs", os.environ.get("SUBTITLE_DOWNLOAD_HEARING_IMPAIRED_SUBS")) - if os.environ.get("SUBTITLE_DOWNLOAD_PROVIDERS"): - safeConfigParser.set("Subtitle", "download-providers", os.environ.get("SUBTITLE_DOWNLOAD_PROVIDERS")) - else: - safeConfigParser.set("Subtitle", "download-providers", " ") - if os.environ.get("SUBTITLE_EMBED_SUBS"): - safeConfigParser.set("Subtitle", "embed-subs", os.environ.get("SUBTITLE_EMBED_SUBS")) - if os.environ.get("SUBTITLE_EMBED_IMAGE_SUBS"): - safeConfigParser.set("Subtitle", "embed-image-subs", os.environ.get("SUBTITLE_EMBED_IMAGE_SUBS")) - if os.environ.get("SUBTITLE_EMBED_ONLY_INTERNAL_SUBS"): - safeConfigParser.set("Subtitle", "embed-only-internal-subs", os.environ.get("SUBTITLE_EMBED_ONLY_INTERNAL_SUBS")) - if os.environ.get("SUBTITLE_FILENAME_DISPOSITIONS"): - safeConfigParser.set("Subtitle", "filename-dispositions", os.environ.get("SUBTITLE_FILENAME_DISPOSITIONS")) - if os.environ.get("SUBTITLE_IGNORE_EMBEDDED_SUBS"): - safeConfigParser.set("Subtitle", "ignore-embedded-subs", os.environ.get("SUBTITLE_IGNORE_EMBEDDED_SUBS")) - if os.environ.get("SUBTITLE_ATTACHMENT_CODEC"): - safeConfigParser.set("Subtitle", "attachment-codec", os.environ.get("SUBTITLE_ATTACHMENT_CODEC")) - else: - safeConfigParser.set("Subtitle", "attachment-codec", " ") - - # Set Plex Settings - if os.environ.get("PLEX_HOST"): - safeConfigParser.set("Plex", "host", os.environ.get("PLEX_HOST")) - if os.environ.get("PLEX_PORT"): - safeConfigParser.set("Plex", "port", os.environ.get("PLEX_PORT")) - if os.environ.get("PLEX_REFRESH"): - safeConfigParser.set("Plex", "refresh", os.environ.get("PLEX_REFRESH")) - if os.environ.get("PLEX_TOKEN"): - safeConfigParser.set("Plex", "token", os.environ.get("PLEX_TOKEN")) - + fp = open(autoProcess, "w") safeConfigParser.write(fp) fp.close() From 376aa54e5cf3eaf6c3fd381365eb4c7cd5d4f9d4 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Mon, 20 Apr 2020 14:24:13 -0400 Subject: [PATCH 07/11] Move update --- root/etc/cont-init.d/32-sma-setup.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/root/etc/cont-init.d/32-sma-setup.bash b/root/etc/cont-init.d/32-sma-setup.bash index 23d71b3..2bc8f6c 100644 --- a/root/etc/cont-init.d/32-sma-setup.bash +++ b/root/etc/cont-init.d/32-sma-setup.bash @@ -25,7 +25,8 @@ fi # import new config, if does not exist if [ ! -f "/config/scripts/configs/autoProcess.ini" ]; then - cp "/usr/local/sma/setup/autoProcess.ini.sample" "/config/scripts/configs/autoProcess.ini" + cp "/usr/local/sma/setup/autoProcess.ini.sample" "/config/scripts/configs/autoProcess.ini" && \ + python3 /scripts/update.py fi # create sma log file From b5847d8dc4ab1e6c8aa18f7dd583b40d518c1f7b Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Mon, 20 Apr 2020 14:25:35 -0400 Subject: [PATCH 08/11] Re-add clearing of hwaccels & hwaccel-decoders --- root/scripts/update.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/root/scripts/update.py b/root/scripts/update.py index 6abc64d..fa674c1 100644 --- a/root/scripts/update.py +++ b/root/scripts/update.py @@ -16,6 +16,8 @@ def main(): # Set Converter Settings safeConfigParser.set("Converter", "ffmpeg", "ffmpeg") safeConfigParser.set("Converter", "ffprobe", "ffprobe") + safeConfigParser.set("Converter", "hwaccels", " ") + safeConfigParser.set("Converter", "hwaccel-decoders", " ") fp = open(autoProcess, "w") safeConfigParser.write(fp) From 8602a9c0fa15ef03ac91071c67a952adfd8c0cd5 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Mon, 20 Apr 2020 14:25:51 -0400 Subject: [PATCH 09/11] Delete 35-sma-config-update.bash --- root/etc/cont-init.d/35-sma-config-update.bash | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 root/etc/cont-init.d/35-sma-config-update.bash diff --git a/root/etc/cont-init.d/35-sma-config-update.bash b/root/etc/cont-init.d/35-sma-config-update.bash deleted file mode 100644 index 992343f..0000000 --- a/root/etc/cont-init.d/35-sma-config-update.bash +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/with-contenv bash - -# update autoprocess -python3 /scripts/update.py - -exit $? From ea9e22958dc5a782a7e527838ebea62c3500daff Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Mon, 20 Apr 2020 14:30:26 -0400 Subject: [PATCH 10/11] Move beets config file location --- root/etc/cont-init.d/33-script-setup.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/root/etc/cont-init.d/33-script-setup.bash b/root/etc/cont-init.d/33-script-setup.bash index ab399bd..162ed7e 100644 --- a/root/etc/cont-init.d/33-script-setup.bash +++ b/root/etc/cont-init.d/33-script-setup.bash @@ -9,9 +9,9 @@ if [ -f "/config/scripts/audio-pp.bash" ]; then fi # cp config file for use -if [ ! -f "/config/scripts/beets-config.yaml" ]; then - cp "/usr/local/sabnzbd-scripts/beets-config.yaml" "/config/scripts/beets-config.yaml" && \ - chmod 0666 "/config/scripts/beets-config.yaml" +if [ ! -f "/config/scripts/configs/beets-config.yaml" ]; then + cp "/usr/local/sabnzbd-scripts/beets-config.yaml" "/config/scripts/configs/beets-config.yaml" && \ + chmod 0666 "/config/scripts/configs/beets-config.yaml" fi # cp config file for use From d9f04f834c0c5299183482079cac4deb717ee43d Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Mon, 20 Apr 2020 14:38:16 -0400 Subject: [PATCH 11/11] cleanup old scripts --- root/etc/cont-init.d/33-script-setup.bash | 40 +++++++---------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/root/etc/cont-init.d/33-script-setup.bash b/root/etc/cont-init.d/33-script-setup.bash index 162ed7e..d1a33e5 100644 --- a/root/etc/cont-init.d/33-script-setup.bash +++ b/root/etc/cont-init.d/33-script-setup.bash @@ -3,56 +3,38 @@ # set permissions chmod 0777 -R /usr/local/sabnzbd-scripts + +# remove existing audio-pp script file if [ -f "/config/scripts/audio-pp.bash" ]; then rm "/config/scripts/audio-pp.bash" sleep 0.1 fi -# cp config file for use +# cp audio-pp script file for use +if [ ! -f "/config/scripts/audio-pp.bash" ]; then + cp "/usr/local/sabnzbd-scripts/audio-pp.bash" "/config/scripts/audio-pp.bash" && \ + chmod 0777 "/config/scripts/audio-pp.bash" +fi + +# cp beets config file for use if [ ! -f "/config/scripts/configs/beets-config.yaml" ]; then cp "/usr/local/sabnzbd-scripts/beets-config.yaml" "/config/scripts/configs/beets-config.yaml" && \ chmod 0666 "/config/scripts/configs/beets-config.yaml" fi -# cp config file for use -if [ ! -f "/config/scripts/audio-pp.bash" ]; then - cp "/usr/local/sabnzbd-scripts/audio-pp.bash" "/config/scripts/audio-pp.bash" && \ - chmod 0777 "/config/scripts/audio-pp.bash" -fi +# remove existing video-pp script file if [ -f "/config/scripts/video-pp.bash" ]; then rm "/config/scripts/video-pp.bash" sleep 0.1 fi -# cp config file for use +# cp video-pp script file for use if [ ! -f "/config/scripts/video-pp.bash" ]; then cp "/usr/local/sabnzbd-scripts/sabnzbd/video-pp.bash" "/config/scripts/video-pp.bash" && \ chmod 0777 "/config/scripts/video-pp.bash" fi -if [ -f "/config/scripts/radarr-pp.bash" ]; then - rm "/config/scripts/radarr-pp.bash" - sleep 0.1 -fi - -# link config file for use -if [ ! -f "/config/scripts/radarr-pp.bash" ]; then - cp "/usr/local/sabnzbd-scripts/sabnzbd/radarr-pp.bash" "/config/scripts/" && \ - chmod 0777 "/config/scripts/radarr-pp.bash" -fi - -if [ -f "/config/scripts/sonarr-pp.bash" ]; then - rm "/config/scripts/sonarr-pp.bash" - sleep 0.1 -fi - -# link config file for use -if [ ! -f "/config/scripts/sonarr-pp.bash" ]; then - cp "/usr/local/sabnzbd-scripts/sabnzbd/sonarr-pp.bash" "/config/scripts/" && \ - chmod 0777 "/config/scripts/sonarr-pp.bash" -fi - if [ ! -f "/config/sabnzbd.ini" ]; then # start cron service cron start