From 85da15685f7a761af3a34f1c591bf129aa5deb5f Mon Sep 17 00:00:00 2001 From: Andreas B <6439218+YouKnowBlom@users.noreply.github.com> Date: Sun, 15 Mar 2020 15:06:38 +0100 Subject: [PATCH 001/115] Refactor DynamicHlsService.AppendPlaylist to use StringBuilder --- MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 262f517869..8787eb2a3f 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -724,7 +724,10 @@ namespace MediaBrowser.Api.Playback.Hls private void AppendPlaylist(StringBuilder builder, StreamState state, string url, int bitrate, string subtitleGroup) { - var header = "#EXT-X-STREAM-INF:BANDWIDTH=" + bitrate.ToString(CultureInfo.InvariantCulture) + ",AVERAGE-BANDWIDTH=" + bitrate.ToString(CultureInfo.InvariantCulture); + builder.Append("#EXT-X-STREAM-INF:BANDWIDTH=") + .Append(bitrate.ToString(CultureInfo.InvariantCulture)) + .Append(",AVERAGE-BANDWIDTH=") + .Append(bitrate.ToString(CultureInfo.InvariantCulture)); // tvos wants resolution, codecs, framerate //if (state.TargetFramerate.HasValue) @@ -734,10 +737,12 @@ namespace MediaBrowser.Api.Playback.Hls if (!string.IsNullOrWhiteSpace(subtitleGroup)) { - header += string.Format(",SUBTITLES=\"{0}\"", subtitleGroup); + builder.Append(",SUBTITLES=\"") + .Append(subtitleGroup) + .Append('"'); } - builder.AppendLine(header); + builder.Append(Environment.NewLine); builder.AppendLine(url); } From f2858878d166df214aee20f2dc0710b766285c91 Mon Sep 17 00:00:00 2001 From: Andreas B <6439218+YouKnowBlom@users.noreply.github.com> Date: Wed, 11 Mar 2020 18:14:36 +0100 Subject: [PATCH 002/115] Add CODECS field to HLS master playlist --- .../Playback/Hls/DynamicHlsService.cs | 110 +++++++++++++++ .../Playback/Hls/HlsCodecStringFactory.cs | 126 ++++++++++++++++++ 2 files changed, 236 insertions(+) create mode 100644 MediaBrowser.Api/Playback/Hls/HlsCodecStringFactory.cs diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 8787eb2a3f..e6c9213912 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -722,6 +722,114 @@ namespace MediaBrowser.Api.Playback.Hls //return state.VideoRequest.VideoBitRate.HasValue; } + /// + /// Gets a formatted string of the output audio codec, for use in the CODECS field. + /// + /// + /// + /// StreamState of the current stream. + /// Formatted audio codec string. + private string GetPlaylistAudioCodecs(StreamState state) + { + + if (string.Equals(state.ActualOutputAudioCodec, "aac", StringComparison.OrdinalIgnoreCase)) + { + string profile = state.GetRequestedProfiles("aac").FirstOrDefault(); + + return HlsCodecStringFactory.GetAACString(profile); + } + else if (string.Equals(state.ActualOutputAudioCodec, "mp3", StringComparison.OrdinalIgnoreCase)) + { + return HlsCodecStringFactory.GetMP3String(); + } + else if (string.Equals(state.ActualOutputAudioCodec, "ac3", StringComparison.OrdinalIgnoreCase)) + { + return HlsCodecStringFactory.GetAC3String(); + } + else if (string.Equals(state.ActualOutputAudioCodec, "eac3", StringComparison.OrdinalIgnoreCase)) + { + return HlsCodecStringFactory.GetEAC3String(); + } + + return string.Empty; + } + + /// + /// Gets a formatted string of the output video codec, for use in the CODECS field. + /// + /// + /// + /// StreamState of the current stream. + /// Formatted video codec string. + private string GetPlaylistVideoCodecs(StreamState state) + { + int level = Convert.ToInt32(state.GetRequestedLevel(state.ActualOutputVideoCodec)); + + if (string.Equals(state.ActualOutputVideoCodec, "h264", StringComparison.OrdinalIgnoreCase)) + { + string profile = state.GetRequestedProfiles("h264").FirstOrDefault(); + + return HlsCodecStringFactory.GetH264String(profile, level); + } + else if (string.Equals(state.ActualOutputVideoCodec, "h265", StringComparison.OrdinalIgnoreCase) + || string.Equals(state.ActualOutputVideoCodec, "hevc", StringComparison.OrdinalIgnoreCase)) + { + string profile = state.GetRequestedProfiles("h265").FirstOrDefault(); + + return HlsCodecStringFactory.GetH265String(profile, level); + } + + return string.Empty; + } + + /// + /// Appends a CODECS field containing formatted strings of + /// the active streams output video and audio codecs. + /// + /// + /// + /// + /// StringBuilder to append the field to. + /// StreamState of the current stream. + private void AppendPlaylistCodecsField(StringBuilder builder, StreamState state) + { + // Video + string videoCodecs = string.Empty; + if (!string.IsNullOrEmpty(state.ActualOutputVideoCodec)) + { + videoCodecs = GetPlaylistVideoCodecs(state); + } + + // Audio + string audioCodecs = string.Empty; + if (!string.IsNullOrEmpty(state.ActualOutputAudioCodec)) + { + audioCodecs = GetPlaylistAudioCodecs(state); + } + + if (!string.IsNullOrEmpty(videoCodecs) || !string.IsNullOrEmpty(audioCodecs)) + { + builder.Append(",CODECS=\""); + + if (!string.IsNullOrEmpty(videoCodecs) && !string.IsNullOrEmpty(audioCodecs)) + { + builder.Append(videoCodecs) + .Append(',') + .Append(audioCodecs); + } + else if (!string.IsNullOrEmpty(videoCodecs)) + { + builder.Append(videoCodecs); + } + else if (!string.IsNullOrEmpty(audioCodecs)) + { + builder.Append(audioCodecs); + } + + builder.Append('"'); + } + } + private void AppendPlaylist(StringBuilder builder, StreamState state, string url, int bitrate, string subtitleGroup) { builder.Append("#EXT-X-STREAM-INF:BANDWIDTH=") @@ -735,6 +843,8 @@ namespace MediaBrowser.Api.Playback.Hls // header += string.Format(",FRAME-RATE=\"{0}\"", state.TargetFramerate.Value.ToString(CultureInfo.InvariantCulture)); //} + AppendPlaylistCodecsField(builder, state); + if (!string.IsNullOrWhiteSpace(subtitleGroup)) { builder.Append(",SUBTITLES=\"") diff --git a/MediaBrowser.Api/Playback/Hls/HlsCodecStringFactory.cs b/MediaBrowser.Api/Playback/Hls/HlsCodecStringFactory.cs new file mode 100644 index 0000000000..3bbb77a65e --- /dev/null +++ b/MediaBrowser.Api/Playback/Hls/HlsCodecStringFactory.cs @@ -0,0 +1,126 @@ +using System; +using System.Text; + + +namespace MediaBrowser.Api.Playback +{ + /// + /// Get various codec strings for use in HLS playlists. + /// + static class HlsCodecStringFactory + { + + /// + /// Gets a MP3 codec string. + /// + /// MP3 codec string. + public static string GetMP3String() + { + return "mp4a.40.34"; + } + + /// + /// Gets an AAC codec string. + /// + /// AAC profile. + /// AAC codec string. + public static string GetAACString(string profile) + { + StringBuilder result = new StringBuilder("mp4a", 9); + + if (string.Equals(profile, "HE", StringComparison.OrdinalIgnoreCase)) + { + result.Append(".40.5"); + } + else + { + // Default to LC if profile is invalid + result.Append(".40.2"); + } + + return result.ToString(); + } + + /// + /// Gets a H.264 codec string. + /// + /// H.264 profile. + /// H.264 level. + /// H.264 string. + public static string GetH264String(string profile, int level) + { + StringBuilder result = new StringBuilder("avc1", 11); + + if (string.Equals(profile, "high", StringComparison.OrdinalIgnoreCase)) + { + result.Append(".6400"); + } + else if (string.Equals(profile, "main", StringComparison.OrdinalIgnoreCase)) + { + result.Append(".4D40"); + } + else if (string.Equals(profile, "baseline", StringComparison.OrdinalIgnoreCase)) + { + result.Append(".42E0"); + } + else + { + // Default to constrained baseline if profile is invalid + result.Append(".4240"); + } + + string levelHex = level.ToString("X2"); + result.Append(levelHex); + + return result.ToString(); + } + + /// + /// Gets a H.265 codec string. + /// + /// H.265 profile. + /// H.265 level. + /// H.265 string. + public static string GetH265String(string profile, int level) + { + // The h265 syntax is a bit of a mystery at the time this comment was written. + // This is what I've found through various sources: + // FORMAT: [codecTag].[profile].[constraint?].L[level * 30].[UNKNOWN] + StringBuilder result = new StringBuilder("hev1", 16); + + if (string.Equals(profile, "main10", StringComparison.OrdinalIgnoreCase)) + { + result.Append(".2.6"); + } + else + { + // Default to main if profile is invalid + result.Append(".1.6"); + } + + result.Append(".L") + .Append(level * 3) + .Append(".B0"); + + return result.ToString(); + } + + /// + /// Gets an AC-3 codec string. + /// + /// AC-3 codec string. + public static string GetAC3String() + { + return "mp4a.a5"; + } + + /// + /// Gets an E-AC-3 codec string. + /// + /// E-AC-3 codec string. + public static string GetEAC3String() + { + return "mp4a.a6"; + } + } +} From 8a990d1d95aa22840bae5c3494cb5371bcf2b4d8 Mon Sep 17 00:00:00 2001 From: Andreas B <6439218+YouKnowBlom@users.noreply.github.com> Date: Wed, 11 Mar 2020 18:16:57 +0100 Subject: [PATCH 003/115] Add FRAME-RATE field to HLS master playlist --- .../Playback/Hls/DynamicHlsService.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index e6c9213912..d56b5cbff4 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -830,6 +830,32 @@ namespace MediaBrowser.Api.Playback.Hls } } + /// + /// Appends a FRAME-RATE field containing the framerate of the output stream. + /// + /// + /// StringBuilder to append the field to. + /// StreamState of the current stream. + private void AppendPlaylistFramerateField(StringBuilder builder, StreamState state) + { + double? framerate = null; + if (state.TargetFramerate.HasValue) + { + framerate = Math.Round(state.TargetFramerate.GetValueOrDefault(), 3); + } + else if (state.VideoStream.RealFrameRate.HasValue) + { + framerate = Math.Round(state.VideoStream.RealFrameRate.GetValueOrDefault(), 3); + } + + if (framerate.HasValue) + { + builder.Append(",FRAME-RATE=\"") + .Append(framerate.Value) + .Append('"'); + } + } + private void AppendPlaylist(StringBuilder builder, StreamState state, string url, int bitrate, string subtitleGroup) { builder.Append("#EXT-X-STREAM-INF:BANDWIDTH=") @@ -845,6 +871,8 @@ namespace MediaBrowser.Api.Playback.Hls AppendPlaylistCodecsField(builder, state); + AppendPlaylistFramerateField(builder, state); + if (!string.IsNullOrWhiteSpace(subtitleGroup)) { builder.Append(",SUBTITLES=\"") From 0a2d24aff3d2e78c97b4b2294a418e2cd4a16be1 Mon Sep 17 00:00:00 2001 From: Andreas B <6439218+YouKnowBlom@users.noreply.github.com> Date: Sun, 15 Mar 2020 18:13:19 +0100 Subject: [PATCH 004/115] Add RESOLUTION field to HLS master playlist --- .../Playback/Hls/DynamicHlsService.cs | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index d56b5cbff4..ce25676ff5 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -856,6 +856,24 @@ namespace MediaBrowser.Api.Playback.Hls } } + /// + /// Appends a RESOLUTION field containing the resolution of the output stream. + /// + /// + /// StringBuilder to append the field to. + /// StreamState of the current stream. + private void AppendPlaylistResolutionField(StringBuilder builder, StreamState state) + { + if (state.OutputWidth.HasValue && state.OutputHeight.HasValue) + { + builder.Append(",RESOLUTION=\"") + .Append(state.OutputWidth.GetValueOrDefault()) + .Append('x') + .Append(state.OutputHeight.GetValueOrDefault()) + .Append('"'); + } + } + private void AppendPlaylist(StringBuilder builder, StreamState state, string url, int bitrate, string subtitleGroup) { builder.Append("#EXT-X-STREAM-INF:BANDWIDTH=") @@ -863,14 +881,10 @@ namespace MediaBrowser.Api.Playback.Hls .Append(",AVERAGE-BANDWIDTH=") .Append(bitrate.ToString(CultureInfo.InvariantCulture)); - // tvos wants resolution, codecs, framerate - //if (state.TargetFramerate.HasValue) - //{ - // header += string.Format(",FRAME-RATE=\"{0}\"", state.TargetFramerate.Value.ToString(CultureInfo.InvariantCulture)); - //} - AppendPlaylistCodecsField(builder, state); + AppendPlaylistResolutionField(builder, state); + AppendPlaylistFramerateField(builder, state); if (!string.IsNullOrWhiteSpace(subtitleGroup)) From 2afbbba3f874884e7f249bacb9de458244242380 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 22 Mar 2020 16:00:20 -0400 Subject: [PATCH 005/115] Remove old build script --- build | 197 ---------------------------------------------------------- 1 file changed, 197 deletions(-) delete mode 100755 build diff --git a/build b/build deleted file mode 100755 index 95d5d5c495..0000000000 --- a/build +++ /dev/null @@ -1,197 +0,0 @@ -#!/usr/bin/env bash - -# build - build Jellyfin binaries or packages - -set -o errexit -set -o pipefail - -# The list of possible package actions (except 'clean') -declare -a actions=( 'build' 'package' 'sign' 'publish' ) - -# The list of possible platforms, based on directories under 'deployment/' -declare -a platforms=( $( - find deployment/ -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | sort -) ) - -# The list of standard dependencies required by all build scripts; individual -# action scripts may specify their own dependencies -declare -a dependencies=( 'tar' 'zip' ) - -usage() { - echo -e "build - build Jellyfin binaries or packages" - echo -e "" - echo -e "Usage:" - echo -e " $ build --list-platforms" - echo -e " $ build --list-actions " - echo -e " $ build [-k/--keep-artifacts] [-b/--web-branch ] " - echo -e "" - echo -e "The 'keep-artifacts' option preserves build artifacts, e.g. Docker images for system package builds." - echo -e "The web_branch defaults to the same branch name as the current main branch or can be 'local' to not touch the submodule branching." - echo -e "To build all platforms, use 'all'." - echo -e "To perform all build actions, use 'all'." - echo -e "Build output files are collected at '../bin/'." -} - -# Show usage on stderr with exit 1 on argless -if [[ -z $1 ]]; then - usage >&2 - exit 1 -fi -# Show usage if -h or --help are specified in the args -if [[ $@ =~ '-h' || $@ =~ '--help' ]]; then - usage - exit 0 -fi - -# List all available platforms then exit -if [[ $1 == '--list-platforms' ]]; then - echo -e "Available platforms:" - for platform in ${platforms[@]}; do - echo -e " ${platform}" - done - exit 0 -fi - -# List all available actions for a given platform then exit -if [[ $1 == '--list-actions' ]]; then - platform="$2" - if [[ ! " ${platforms[@]} " =~ " ${platform} " ]]; then - echo "ERROR: Platform ${platform} does not exist." - exit 1 - fi - echo -e "Available actions for platform ${platform}:" - for action in ${actions[@]}; do - if [[ -f deployment/${platform}/${action}.sh ]]; then - echo -e " ${action}" - fi - done - exit 0 -fi - -# Parse keep-artifacts option -if [[ $1 == '-k' || $1 == '--keep-artifacts' ]]; then - keep_artifacts="y" - shift 1 -else - keep_artifacts="n" -fi - -# Parse branch option -if [[ $1 == '-b' || $1 == '--web-branch' ]]; then - web_branch="$2" - shift 2 -else - web_branch="$( git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' )" -fi - -# Parse platform option -if [[ -n $1 ]]; then - cli_platform="$1" - shift -else - echo "ERROR: A platform must be specified. Use 'all' to specify all platforms." - exit 1 -fi -if [[ ${cli_platform} == 'all' ]]; then - declare -a platform=( ${platforms[@]} ) -else - if [[ ! " ${platforms[@]} " =~ " ${cli_platform} " ]]; then - echo "ERROR: Platform ${cli_platform} is invalid. Use the '--list-platforms' option to list available platforms." - exit 1 - else - declare -a platform=( "${cli_platform}" ) - fi -fi - -# Parse action option -if [[ -n $1 ]]; then - cli_action="$1" - shift -else - echo "ERROR: An action must be specified. Use 'all' to specify all actions." - exit 1 -fi -if [[ ${cli_action} == 'all' ]]; then - declare -a action=( ${actions[@]} ) -else - if [[ ! " ${actions[@]} " =~ " ${cli_action} " ]]; then - echo "ERROR: Action ${cli_action} is invalid. Use the '--list-actions ' option to list available actions." - exit 1 - else - declare -a action=( "${cli_action}" ) - fi -fi - -# Verify required utilities are installed -missing_deps=() -for utility in ${dependencies[@]}; do - if ! which ${utility} &>/dev/null; then - missing_deps+=( ${utility} ) - fi -done - -# Error if we're missing anything -if [[ ${#missing_deps[@]} -gt 0 ]]; then - echo -e "ERROR: This script requires the following missing utilities:" - for utility in ${missing_deps[@]}; do - echo -e " ${utility}" - done - exit 1 -fi - -# Parse platform-specific dependencies -for target_platform in ${platform[@]}; do - # Read platform-specific dependencies - if [[ -f deployment/${target_platform}/dependencies.txt ]]; then - platform_dependencies="$( grep -v '^#' deployment/${target_platform}/dependencies.txt )" - - # Verify required utilities are installed - missing_deps=() - for utility in ${platform_dependencies[@]}; do - if ! which ${utility} &>/dev/null; then - missing_deps+=( ${utility} ) - fi - done - - # Error if we're missing anything - if [[ ${#missing_deps[@]} -gt 0 ]]; then - echo -e "ERROR: The ${target_platform} platform requires the following utilities:" - for utility in ${missing_deps[@]}; do - echo -e " ${utility}" - done - exit 1 - fi - fi -done - -# Execute each platform and action in order, if said action is enabled -pushd deployment/ -for target_platform in ${platform[@]}; do - echo -e "> Processing platform ${target_platform}" - date_start=$( date +%s ) - pushd ${target_platform} - cleanup() { - echo -e ">> Processing action clean" - if [[ -f clean.sh && -x clean.sh ]]; then - ./clean.sh ${keep_artifacts} - fi - } - trap cleanup EXIT INT - for target_action in ${action[@]}; do - echo -e ">> Processing action ${target_action}" - if [[ -f ${target_action}.sh && -x ${target_action}.sh ]]; then - ./${target_action}.sh web_branch=${web_branch} - fi - done - if [[ -d pkg-dist/ ]]; then - echo -e ">> Collecting build artifacts" - target_dir="../../../bin/${target_platform}" - mkdir -p ${target_dir} - mv pkg-dist/* ${target_dir}/ - fi - cleanup - date_end=$( date +%s ) - echo -e "> Completed platform ${target_platform} in $( expr ${date_end} - ${date_start} ) seconds." - popd -done -popd From 28f7df652015013ff5cedb10971fb69c8e41d2b1 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 22 Mar 2020 16:00:52 -0400 Subject: [PATCH 006/115] Move all old deployment stuff to a new folder --- .../fedora-package-x64/pkg-src/restart.sh | 36 ------------------- deployment/{ => old}/README.md | 0 .../{ => old}/centos-package-x64/Dockerfile | 0 .../{ => old}/centos-package-x64/clean.sh | 0 .../centos-package-x64/dependencies.txt | 0 .../centos-package-x64/docker-build.sh | 0 .../{ => old}/centos-package-x64/package.sh | 0 .../{ => old}/centos-package-x64/pkg-src | 0 .../debian-package-arm64/Dockerfile.amd64 | 0 .../debian-package-arm64/Dockerfile.arm64 | 0 .../{ => old}/debian-package-arm64/clean.sh | 0 .../debian-package-arm64/dependencies.txt | 0 .../debian-package-arm64/docker-build.sh | 0 .../{ => old}/debian-package-arm64/package.sh | 0 .../{ => old}/debian-package-arm64/pkg-src | 0 .../debian-package-armhf/Dockerfile.amd64 | 0 .../debian-package-armhf/Dockerfile.armhf | 0 .../{ => old}/debian-package-armhf/clean.sh | 0 .../debian-package-armhf/dependencies.txt | 0 .../debian-package-armhf/docker-build.sh | 0 .../{ => old}/debian-package-armhf/package.sh | 0 .../{ => old}/debian-package-armhf/pkg-src | 0 .../{ => old}/debian-package-x64/Dockerfile | 0 .../{ => old}/debian-package-x64/clean.sh | 0 .../debian-package-x64/dependencies.txt | 0 .../debian-package-x64/docker-build.sh | 0 .../{ => old}/debian-package-x64/package.sh | 0 .../debian-package-x64/pkg-src/changelog | 0 .../debian-package-x64/pkg-src/compat | 0 .../debian-package-x64/pkg-src/conf/jellyfin | 0 .../pkg-src/conf/jellyfin-sudoers | 0 .../pkg-src/conf/jellyfin.service.conf | 0 .../pkg-src/conf/logging.json | 0 .../debian-package-x64/pkg-src/control | 0 .../debian-package-x64/pkg-src/copyright | 0 .../debian-package-x64/pkg-src/gbp.conf | 0 .../debian-package-x64/pkg-src/install | 0 .../debian-package-x64/pkg-src/jellyfin.init | 0 .../pkg-src/jellyfin.service | 0 .../pkg-src/jellyfin.upstart | 0 .../debian-package-x64/pkg-src/po/POTFILES.in | 0 .../pkg-src/po/templates.pot | 0 .../debian-package-x64/pkg-src/postinst | 0 .../debian-package-x64/pkg-src/postrm | 0 .../debian-package-x64/pkg-src/preinst | 0 .../debian-package-x64/pkg-src/prerm | 0 .../debian-package-x64/pkg-src/rules | 0 .../pkg-src/source.lintian-overrides | 0 .../debian-package-x64/pkg-src/source/format | 0 .../debian-package-x64/pkg-src/source/options | 0 .../{ => old}/fedora-package-x64/Dockerfile | 0 .../{ => old}/fedora-package-x64/clean.sh | 0 .../fedora-package-x64/dependencies.txt | 0 .../fedora-package-x64/docker-build.sh | 0 .../{ => old}/fedora-package-x64/package.sh | 0 .../fedora-package-x64/pkg-src/.gitignore | 0 .../fedora-package-x64/pkg-src/README.md | 0 .../pkg-src/jellyfin-firewalld.xml | 0 .../fedora-package-x64/pkg-src/jellyfin.env | 0 .../pkg-src/jellyfin.override.conf | 0 .../pkg-src/jellyfin.service | 0 .../fedora-package-x64/pkg-src/jellyfin.spec | 0 .../pkg-src/jellyfin.sudoers | 0 .../fedora-package-x64/pkg-src}/restart.sh | 0 deployment/{ => old}/linux-x64/Dockerfile | 0 deployment/{ => old}/linux-x64/clean.sh | 0 .../{ => old}/linux-x64/dependencies.txt | 0 .../{ => old}/linux-x64/docker-build.sh | 0 deployment/{ => old}/linux-x64/package.sh | 0 deployment/{ => old}/macos/Dockerfile | 0 deployment/{ => old}/macos/clean.sh | 0 deployment/{ => old}/macos/dependencies.txt | 0 deployment/{ => old}/macos/docker-build.sh | 0 deployment/{ => old}/macos/package.sh | 0 deployment/{ => old}/portable/Dockerfile | 0 deployment/{ => old}/portable/clean.sh | 0 .../{ => old}/portable/dependencies.txt | 0 deployment/{ => old}/portable/docker-build.sh | 0 deployment/{ => old}/portable/package.sh | 0 .../ubuntu-package-arm64/Dockerfile.amd64 | 0 .../ubuntu-package-arm64/Dockerfile.arm64 | 0 .../{ => old}/ubuntu-package-arm64/clean.sh | 0 .../ubuntu-package-arm64/dependencies.txt | 0 .../ubuntu-package-arm64/docker-build.sh | 0 .../{ => old}/ubuntu-package-arm64/package.sh | 0 .../{ => old}/ubuntu-package-arm64/pkg-src | 0 .../ubuntu-package-armhf/Dockerfile.amd64 | 0 .../ubuntu-package-armhf/Dockerfile.armhf | 0 .../{ => old}/ubuntu-package-armhf/clean.sh | 0 .../ubuntu-package-armhf/dependencies.txt | 0 .../ubuntu-package-armhf/docker-build.sh | 0 .../{ => old}/ubuntu-package-armhf/package.sh | 0 .../{ => old}/ubuntu-package-armhf/pkg-src | 0 .../{ => old}/ubuntu-package-x64/Dockerfile | 0 .../{ => old}/ubuntu-package-x64/clean.sh | 0 .../ubuntu-package-x64/dependencies.txt | 0 .../ubuntu-package-x64/docker-build.sh | 0 .../{ => old}/ubuntu-package-x64/package.sh | 0 .../{ => old}/ubuntu-package-x64/pkg-src | 0 .../unraid/docker-templates/README.md | 0 .../unraid/docker-templates/jellyfin.xml | 0 deployment/{ => old}/win-x64/Dockerfile | 0 deployment/{ => old}/win-x64/clean.sh | 0 deployment/{ => old}/win-x64/dependencies.txt | 0 deployment/{ => old}/win-x64/docker-build.sh | 0 deployment/{ => old}/win-x64/package.sh | 0 deployment/{ => old}/win-x86/Dockerfile | 0 deployment/{ => old}/win-x86/clean.sh | 0 deployment/{ => old}/win-x86/dependencies.txt | 0 deployment/{ => old}/win-x86/docker-build.sh | 0 deployment/{ => old}/win-x86/package.sh | 0 .../{ => old}/windows/build-jellyfin.ps1 | 0 deployment/{ => old}/windows/dependencies.txt | 0 .../windows/dialogs/confirmation.nsddef | 0 .../windows/dialogs/confirmation.nsdinc | 0 .../windows/dialogs/service-config.nsddef | 0 .../windows/dialogs/service-config.nsdinc | 0 .../windows/dialogs/setuptype.nsddef | 0 .../windows/dialogs/setuptype.nsdinc | 0 .../{ => old}/windows/helpers/ShowError.nsh | 0 .../{ => old}/windows/helpers/StrSlash.nsh | 0 deployment/{ => old}/windows/jellyfin.nsi | 0 .../windows/legacy/install-jellyfin.ps1 | 0 .../{ => old}/windows/legacy/install.bat | 0 124 files changed, 36 deletions(-) delete mode 100755 deployment/fedora-package-x64/pkg-src/restart.sh rename deployment/{ => old}/README.md (100%) rename deployment/{ => old}/centos-package-x64/Dockerfile (100%) rename deployment/{ => old}/centos-package-x64/clean.sh (100%) rename deployment/{ => old}/centos-package-x64/dependencies.txt (100%) rename deployment/{ => old}/centos-package-x64/docker-build.sh (100%) rename deployment/{ => old}/centos-package-x64/package.sh (100%) rename deployment/{ => old}/centos-package-x64/pkg-src (100%) rename deployment/{ => old}/debian-package-arm64/Dockerfile.amd64 (100%) rename deployment/{ => old}/debian-package-arm64/Dockerfile.arm64 (100%) rename deployment/{ => old}/debian-package-arm64/clean.sh (100%) rename deployment/{ => old}/debian-package-arm64/dependencies.txt (100%) rename deployment/{ => old}/debian-package-arm64/docker-build.sh (100%) rename deployment/{ => old}/debian-package-arm64/package.sh (100%) rename deployment/{ => old}/debian-package-arm64/pkg-src (100%) rename deployment/{ => old}/debian-package-armhf/Dockerfile.amd64 (100%) rename deployment/{ => old}/debian-package-armhf/Dockerfile.armhf (100%) rename deployment/{ => old}/debian-package-armhf/clean.sh (100%) rename deployment/{ => old}/debian-package-armhf/dependencies.txt (100%) rename deployment/{ => old}/debian-package-armhf/docker-build.sh (100%) rename deployment/{ => old}/debian-package-armhf/package.sh (100%) rename deployment/{ => old}/debian-package-armhf/pkg-src (100%) rename deployment/{ => old}/debian-package-x64/Dockerfile (100%) rename deployment/{ => old}/debian-package-x64/clean.sh (100%) rename deployment/{ => old}/debian-package-x64/dependencies.txt (100%) rename deployment/{ => old}/debian-package-x64/docker-build.sh (100%) rename deployment/{ => old}/debian-package-x64/package.sh (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/changelog (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/compat (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/conf/jellyfin (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/conf/jellyfin-sudoers (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/conf/jellyfin.service.conf (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/conf/logging.json (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/control (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/copyright (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/gbp.conf (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/install (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/jellyfin.init (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/jellyfin.service (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/jellyfin.upstart (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/po/POTFILES.in (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/po/templates.pot (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/postinst (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/postrm (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/preinst (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/prerm (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/rules (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/source.lintian-overrides (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/source/format (100%) rename deployment/{ => old}/debian-package-x64/pkg-src/source/options (100%) rename deployment/{ => old}/fedora-package-x64/Dockerfile (100%) rename deployment/{ => old}/fedora-package-x64/clean.sh (100%) rename deployment/{ => old}/fedora-package-x64/dependencies.txt (100%) rename deployment/{ => old}/fedora-package-x64/docker-build.sh (100%) rename deployment/{ => old}/fedora-package-x64/package.sh (100%) rename deployment/{ => old}/fedora-package-x64/pkg-src/.gitignore (100%) rename deployment/{ => old}/fedora-package-x64/pkg-src/README.md (100%) rename deployment/{ => old}/fedora-package-x64/pkg-src/jellyfin-firewalld.xml (100%) rename deployment/{ => old}/fedora-package-x64/pkg-src/jellyfin.env (100%) rename deployment/{ => old}/fedora-package-x64/pkg-src/jellyfin.override.conf (100%) rename deployment/{ => old}/fedora-package-x64/pkg-src/jellyfin.service (100%) rename deployment/{ => old}/fedora-package-x64/pkg-src/jellyfin.spec (100%) rename deployment/{ => old}/fedora-package-x64/pkg-src/jellyfin.sudoers (100%) rename deployment/{debian-package-x64/pkg-src/bin => old/fedora-package-x64/pkg-src}/restart.sh (100%) rename deployment/{ => old}/linux-x64/Dockerfile (100%) rename deployment/{ => old}/linux-x64/clean.sh (100%) rename deployment/{ => old}/linux-x64/dependencies.txt (100%) rename deployment/{ => old}/linux-x64/docker-build.sh (100%) rename deployment/{ => old}/linux-x64/package.sh (100%) rename deployment/{ => old}/macos/Dockerfile (100%) rename deployment/{ => old}/macos/clean.sh (100%) rename deployment/{ => old}/macos/dependencies.txt (100%) rename deployment/{ => old}/macos/docker-build.sh (100%) rename deployment/{ => old}/macos/package.sh (100%) rename deployment/{ => old}/portable/Dockerfile (100%) rename deployment/{ => old}/portable/clean.sh (100%) rename deployment/{ => old}/portable/dependencies.txt (100%) rename deployment/{ => old}/portable/docker-build.sh (100%) rename deployment/{ => old}/portable/package.sh (100%) rename deployment/{ => old}/ubuntu-package-arm64/Dockerfile.amd64 (100%) rename deployment/{ => old}/ubuntu-package-arm64/Dockerfile.arm64 (100%) rename deployment/{ => old}/ubuntu-package-arm64/clean.sh (100%) rename deployment/{ => old}/ubuntu-package-arm64/dependencies.txt (100%) rename deployment/{ => old}/ubuntu-package-arm64/docker-build.sh (100%) rename deployment/{ => old}/ubuntu-package-arm64/package.sh (100%) rename deployment/{ => old}/ubuntu-package-arm64/pkg-src (100%) rename deployment/{ => old}/ubuntu-package-armhf/Dockerfile.amd64 (100%) rename deployment/{ => old}/ubuntu-package-armhf/Dockerfile.armhf (100%) rename deployment/{ => old}/ubuntu-package-armhf/clean.sh (100%) rename deployment/{ => old}/ubuntu-package-armhf/dependencies.txt (100%) rename deployment/{ => old}/ubuntu-package-armhf/docker-build.sh (100%) rename deployment/{ => old}/ubuntu-package-armhf/package.sh (100%) rename deployment/{ => old}/ubuntu-package-armhf/pkg-src (100%) rename deployment/{ => old}/ubuntu-package-x64/Dockerfile (100%) rename deployment/{ => old}/ubuntu-package-x64/clean.sh (100%) rename deployment/{ => old}/ubuntu-package-x64/dependencies.txt (100%) rename deployment/{ => old}/ubuntu-package-x64/docker-build.sh (100%) rename deployment/{ => old}/ubuntu-package-x64/package.sh (100%) rename deployment/{ => old}/ubuntu-package-x64/pkg-src (100%) rename deployment/{ => old}/unraid/docker-templates/README.md (100%) rename deployment/{ => old}/unraid/docker-templates/jellyfin.xml (100%) rename deployment/{ => old}/win-x64/Dockerfile (100%) rename deployment/{ => old}/win-x64/clean.sh (100%) rename deployment/{ => old}/win-x64/dependencies.txt (100%) rename deployment/{ => old}/win-x64/docker-build.sh (100%) rename deployment/{ => old}/win-x64/package.sh (100%) rename deployment/{ => old}/win-x86/Dockerfile (100%) rename deployment/{ => old}/win-x86/clean.sh (100%) rename deployment/{ => old}/win-x86/dependencies.txt (100%) rename deployment/{ => old}/win-x86/docker-build.sh (100%) rename deployment/{ => old}/win-x86/package.sh (100%) rename deployment/{ => old}/windows/build-jellyfin.ps1 (100%) rename deployment/{ => old}/windows/dependencies.txt (100%) rename deployment/{ => old}/windows/dialogs/confirmation.nsddef (100%) rename deployment/{ => old}/windows/dialogs/confirmation.nsdinc (100%) rename deployment/{ => old}/windows/dialogs/service-config.nsddef (100%) rename deployment/{ => old}/windows/dialogs/service-config.nsdinc (100%) rename deployment/{ => old}/windows/dialogs/setuptype.nsddef (100%) rename deployment/{ => old}/windows/dialogs/setuptype.nsdinc (100%) rename deployment/{ => old}/windows/helpers/ShowError.nsh (100%) rename deployment/{ => old}/windows/helpers/StrSlash.nsh (100%) rename deployment/{ => old}/windows/jellyfin.nsi (100%) rename deployment/{ => old}/windows/legacy/install-jellyfin.ps1 (100%) rename deployment/{ => old}/windows/legacy/install.bat (100%) diff --git a/deployment/fedora-package-x64/pkg-src/restart.sh b/deployment/fedora-package-x64/pkg-src/restart.sh deleted file mode 100755 index 9b64b6d728..0000000000 --- a/deployment/fedora-package-x64/pkg-src/restart.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# restart.sh - Jellyfin server restart script -# Part of the Jellyfin project (https://github.com/jellyfin) -# -# This script restarts the Jellyfin daemon on Linux when using -# the Restart button on the admin dashboard. It supports the -# systemctl, service, and traditional /etc/init.d (sysv) restart -# methods, chosen automatically by which one is found first (in -# that order). -# -# This script is used by the Debian/Ubuntu/Fedora/CentOS packages. - -get_service_command() { - for command in systemctl service; do - if which $command &>/dev/null; then - echo $command && return - fi - done - echo "sysv" -} - -cmd="$( get_service_command )" -echo "Detected service control platform '$cmd'; using it to restart Jellyfin..." -case $cmd in - 'systemctl') - echo "sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin" | at now - ;; - 'service') - echo "sleep 2; /usr/bin/sudo $( which service ) jellyfin restart" | at now - ;; - 'sysv') - echo "sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart" | at now - ;; -esac -exit 0 diff --git a/deployment/README.md b/deployment/old/README.md similarity index 100% rename from deployment/README.md rename to deployment/old/README.md diff --git a/deployment/centos-package-x64/Dockerfile b/deployment/old/centos-package-x64/Dockerfile similarity index 100% rename from deployment/centos-package-x64/Dockerfile rename to deployment/old/centos-package-x64/Dockerfile diff --git a/deployment/centos-package-x64/clean.sh b/deployment/old/centos-package-x64/clean.sh similarity index 100% rename from deployment/centos-package-x64/clean.sh rename to deployment/old/centos-package-x64/clean.sh diff --git a/deployment/centos-package-x64/dependencies.txt b/deployment/old/centos-package-x64/dependencies.txt similarity index 100% rename from deployment/centos-package-x64/dependencies.txt rename to deployment/old/centos-package-x64/dependencies.txt diff --git a/deployment/centos-package-x64/docker-build.sh b/deployment/old/centos-package-x64/docker-build.sh similarity index 100% rename from deployment/centos-package-x64/docker-build.sh rename to deployment/old/centos-package-x64/docker-build.sh diff --git a/deployment/centos-package-x64/package.sh b/deployment/old/centos-package-x64/package.sh similarity index 100% rename from deployment/centos-package-x64/package.sh rename to deployment/old/centos-package-x64/package.sh diff --git a/deployment/centos-package-x64/pkg-src b/deployment/old/centos-package-x64/pkg-src similarity index 100% rename from deployment/centos-package-x64/pkg-src rename to deployment/old/centos-package-x64/pkg-src diff --git a/deployment/debian-package-arm64/Dockerfile.amd64 b/deployment/old/debian-package-arm64/Dockerfile.amd64 similarity index 100% rename from deployment/debian-package-arm64/Dockerfile.amd64 rename to deployment/old/debian-package-arm64/Dockerfile.amd64 diff --git a/deployment/debian-package-arm64/Dockerfile.arm64 b/deployment/old/debian-package-arm64/Dockerfile.arm64 similarity index 100% rename from deployment/debian-package-arm64/Dockerfile.arm64 rename to deployment/old/debian-package-arm64/Dockerfile.arm64 diff --git a/deployment/debian-package-arm64/clean.sh b/deployment/old/debian-package-arm64/clean.sh similarity index 100% rename from deployment/debian-package-arm64/clean.sh rename to deployment/old/debian-package-arm64/clean.sh diff --git a/deployment/debian-package-arm64/dependencies.txt b/deployment/old/debian-package-arm64/dependencies.txt similarity index 100% rename from deployment/debian-package-arm64/dependencies.txt rename to deployment/old/debian-package-arm64/dependencies.txt diff --git a/deployment/debian-package-arm64/docker-build.sh b/deployment/old/debian-package-arm64/docker-build.sh similarity index 100% rename from deployment/debian-package-arm64/docker-build.sh rename to deployment/old/debian-package-arm64/docker-build.sh diff --git a/deployment/debian-package-arm64/package.sh b/deployment/old/debian-package-arm64/package.sh similarity index 100% rename from deployment/debian-package-arm64/package.sh rename to deployment/old/debian-package-arm64/package.sh diff --git a/deployment/debian-package-arm64/pkg-src b/deployment/old/debian-package-arm64/pkg-src similarity index 100% rename from deployment/debian-package-arm64/pkg-src rename to deployment/old/debian-package-arm64/pkg-src diff --git a/deployment/debian-package-armhf/Dockerfile.amd64 b/deployment/old/debian-package-armhf/Dockerfile.amd64 similarity index 100% rename from deployment/debian-package-armhf/Dockerfile.amd64 rename to deployment/old/debian-package-armhf/Dockerfile.amd64 diff --git a/deployment/debian-package-armhf/Dockerfile.armhf b/deployment/old/debian-package-armhf/Dockerfile.armhf similarity index 100% rename from deployment/debian-package-armhf/Dockerfile.armhf rename to deployment/old/debian-package-armhf/Dockerfile.armhf diff --git a/deployment/debian-package-armhf/clean.sh b/deployment/old/debian-package-armhf/clean.sh similarity index 100% rename from deployment/debian-package-armhf/clean.sh rename to deployment/old/debian-package-armhf/clean.sh diff --git a/deployment/debian-package-armhf/dependencies.txt b/deployment/old/debian-package-armhf/dependencies.txt similarity index 100% rename from deployment/debian-package-armhf/dependencies.txt rename to deployment/old/debian-package-armhf/dependencies.txt diff --git a/deployment/debian-package-armhf/docker-build.sh b/deployment/old/debian-package-armhf/docker-build.sh similarity index 100% rename from deployment/debian-package-armhf/docker-build.sh rename to deployment/old/debian-package-armhf/docker-build.sh diff --git a/deployment/debian-package-armhf/package.sh b/deployment/old/debian-package-armhf/package.sh similarity index 100% rename from deployment/debian-package-armhf/package.sh rename to deployment/old/debian-package-armhf/package.sh diff --git a/deployment/debian-package-armhf/pkg-src b/deployment/old/debian-package-armhf/pkg-src similarity index 100% rename from deployment/debian-package-armhf/pkg-src rename to deployment/old/debian-package-armhf/pkg-src diff --git a/deployment/debian-package-x64/Dockerfile b/deployment/old/debian-package-x64/Dockerfile similarity index 100% rename from deployment/debian-package-x64/Dockerfile rename to deployment/old/debian-package-x64/Dockerfile diff --git a/deployment/debian-package-x64/clean.sh b/deployment/old/debian-package-x64/clean.sh similarity index 100% rename from deployment/debian-package-x64/clean.sh rename to deployment/old/debian-package-x64/clean.sh diff --git a/deployment/debian-package-x64/dependencies.txt b/deployment/old/debian-package-x64/dependencies.txt similarity index 100% rename from deployment/debian-package-x64/dependencies.txt rename to deployment/old/debian-package-x64/dependencies.txt diff --git a/deployment/debian-package-x64/docker-build.sh b/deployment/old/debian-package-x64/docker-build.sh similarity index 100% rename from deployment/debian-package-x64/docker-build.sh rename to deployment/old/debian-package-x64/docker-build.sh diff --git a/deployment/debian-package-x64/package.sh b/deployment/old/debian-package-x64/package.sh similarity index 100% rename from deployment/debian-package-x64/package.sh rename to deployment/old/debian-package-x64/package.sh diff --git a/deployment/debian-package-x64/pkg-src/changelog b/deployment/old/debian-package-x64/pkg-src/changelog similarity index 100% rename from deployment/debian-package-x64/pkg-src/changelog rename to deployment/old/debian-package-x64/pkg-src/changelog diff --git a/deployment/debian-package-x64/pkg-src/compat b/deployment/old/debian-package-x64/pkg-src/compat similarity index 100% rename from deployment/debian-package-x64/pkg-src/compat rename to deployment/old/debian-package-x64/pkg-src/compat diff --git a/deployment/debian-package-x64/pkg-src/conf/jellyfin b/deployment/old/debian-package-x64/pkg-src/conf/jellyfin similarity index 100% rename from deployment/debian-package-x64/pkg-src/conf/jellyfin rename to deployment/old/debian-package-x64/pkg-src/conf/jellyfin diff --git a/deployment/debian-package-x64/pkg-src/conf/jellyfin-sudoers b/deployment/old/debian-package-x64/pkg-src/conf/jellyfin-sudoers similarity index 100% rename from deployment/debian-package-x64/pkg-src/conf/jellyfin-sudoers rename to deployment/old/debian-package-x64/pkg-src/conf/jellyfin-sudoers diff --git a/deployment/debian-package-x64/pkg-src/conf/jellyfin.service.conf b/deployment/old/debian-package-x64/pkg-src/conf/jellyfin.service.conf similarity index 100% rename from deployment/debian-package-x64/pkg-src/conf/jellyfin.service.conf rename to deployment/old/debian-package-x64/pkg-src/conf/jellyfin.service.conf diff --git a/deployment/debian-package-x64/pkg-src/conf/logging.json b/deployment/old/debian-package-x64/pkg-src/conf/logging.json similarity index 100% rename from deployment/debian-package-x64/pkg-src/conf/logging.json rename to deployment/old/debian-package-x64/pkg-src/conf/logging.json diff --git a/deployment/debian-package-x64/pkg-src/control b/deployment/old/debian-package-x64/pkg-src/control similarity index 100% rename from deployment/debian-package-x64/pkg-src/control rename to deployment/old/debian-package-x64/pkg-src/control diff --git a/deployment/debian-package-x64/pkg-src/copyright b/deployment/old/debian-package-x64/pkg-src/copyright similarity index 100% rename from deployment/debian-package-x64/pkg-src/copyright rename to deployment/old/debian-package-x64/pkg-src/copyright diff --git a/deployment/debian-package-x64/pkg-src/gbp.conf b/deployment/old/debian-package-x64/pkg-src/gbp.conf similarity index 100% rename from deployment/debian-package-x64/pkg-src/gbp.conf rename to deployment/old/debian-package-x64/pkg-src/gbp.conf diff --git a/deployment/debian-package-x64/pkg-src/install b/deployment/old/debian-package-x64/pkg-src/install similarity index 100% rename from deployment/debian-package-x64/pkg-src/install rename to deployment/old/debian-package-x64/pkg-src/install diff --git a/deployment/debian-package-x64/pkg-src/jellyfin.init b/deployment/old/debian-package-x64/pkg-src/jellyfin.init similarity index 100% rename from deployment/debian-package-x64/pkg-src/jellyfin.init rename to deployment/old/debian-package-x64/pkg-src/jellyfin.init diff --git a/deployment/debian-package-x64/pkg-src/jellyfin.service b/deployment/old/debian-package-x64/pkg-src/jellyfin.service similarity index 100% rename from deployment/debian-package-x64/pkg-src/jellyfin.service rename to deployment/old/debian-package-x64/pkg-src/jellyfin.service diff --git a/deployment/debian-package-x64/pkg-src/jellyfin.upstart b/deployment/old/debian-package-x64/pkg-src/jellyfin.upstart similarity index 100% rename from deployment/debian-package-x64/pkg-src/jellyfin.upstart rename to deployment/old/debian-package-x64/pkg-src/jellyfin.upstart diff --git a/deployment/debian-package-x64/pkg-src/po/POTFILES.in b/deployment/old/debian-package-x64/pkg-src/po/POTFILES.in similarity index 100% rename from deployment/debian-package-x64/pkg-src/po/POTFILES.in rename to deployment/old/debian-package-x64/pkg-src/po/POTFILES.in diff --git a/deployment/debian-package-x64/pkg-src/po/templates.pot b/deployment/old/debian-package-x64/pkg-src/po/templates.pot similarity index 100% rename from deployment/debian-package-x64/pkg-src/po/templates.pot rename to deployment/old/debian-package-x64/pkg-src/po/templates.pot diff --git a/deployment/debian-package-x64/pkg-src/postinst b/deployment/old/debian-package-x64/pkg-src/postinst similarity index 100% rename from deployment/debian-package-x64/pkg-src/postinst rename to deployment/old/debian-package-x64/pkg-src/postinst diff --git a/deployment/debian-package-x64/pkg-src/postrm b/deployment/old/debian-package-x64/pkg-src/postrm similarity index 100% rename from deployment/debian-package-x64/pkg-src/postrm rename to deployment/old/debian-package-x64/pkg-src/postrm diff --git a/deployment/debian-package-x64/pkg-src/preinst b/deployment/old/debian-package-x64/pkg-src/preinst similarity index 100% rename from deployment/debian-package-x64/pkg-src/preinst rename to deployment/old/debian-package-x64/pkg-src/preinst diff --git a/deployment/debian-package-x64/pkg-src/prerm b/deployment/old/debian-package-x64/pkg-src/prerm similarity index 100% rename from deployment/debian-package-x64/pkg-src/prerm rename to deployment/old/debian-package-x64/pkg-src/prerm diff --git a/deployment/debian-package-x64/pkg-src/rules b/deployment/old/debian-package-x64/pkg-src/rules similarity index 100% rename from deployment/debian-package-x64/pkg-src/rules rename to deployment/old/debian-package-x64/pkg-src/rules diff --git a/deployment/debian-package-x64/pkg-src/source.lintian-overrides b/deployment/old/debian-package-x64/pkg-src/source.lintian-overrides similarity index 100% rename from deployment/debian-package-x64/pkg-src/source.lintian-overrides rename to deployment/old/debian-package-x64/pkg-src/source.lintian-overrides diff --git a/deployment/debian-package-x64/pkg-src/source/format b/deployment/old/debian-package-x64/pkg-src/source/format similarity index 100% rename from deployment/debian-package-x64/pkg-src/source/format rename to deployment/old/debian-package-x64/pkg-src/source/format diff --git a/deployment/debian-package-x64/pkg-src/source/options b/deployment/old/debian-package-x64/pkg-src/source/options similarity index 100% rename from deployment/debian-package-x64/pkg-src/source/options rename to deployment/old/debian-package-x64/pkg-src/source/options diff --git a/deployment/fedora-package-x64/Dockerfile b/deployment/old/fedora-package-x64/Dockerfile similarity index 100% rename from deployment/fedora-package-x64/Dockerfile rename to deployment/old/fedora-package-x64/Dockerfile diff --git a/deployment/fedora-package-x64/clean.sh b/deployment/old/fedora-package-x64/clean.sh similarity index 100% rename from deployment/fedora-package-x64/clean.sh rename to deployment/old/fedora-package-x64/clean.sh diff --git a/deployment/fedora-package-x64/dependencies.txt b/deployment/old/fedora-package-x64/dependencies.txt similarity index 100% rename from deployment/fedora-package-x64/dependencies.txt rename to deployment/old/fedora-package-x64/dependencies.txt diff --git a/deployment/fedora-package-x64/docker-build.sh b/deployment/old/fedora-package-x64/docker-build.sh similarity index 100% rename from deployment/fedora-package-x64/docker-build.sh rename to deployment/old/fedora-package-x64/docker-build.sh diff --git a/deployment/fedora-package-x64/package.sh b/deployment/old/fedora-package-x64/package.sh similarity index 100% rename from deployment/fedora-package-x64/package.sh rename to deployment/old/fedora-package-x64/package.sh diff --git a/deployment/fedora-package-x64/pkg-src/.gitignore b/deployment/old/fedora-package-x64/pkg-src/.gitignore similarity index 100% rename from deployment/fedora-package-x64/pkg-src/.gitignore rename to deployment/old/fedora-package-x64/pkg-src/.gitignore diff --git a/deployment/fedora-package-x64/pkg-src/README.md b/deployment/old/fedora-package-x64/pkg-src/README.md similarity index 100% rename from deployment/fedora-package-x64/pkg-src/README.md rename to deployment/old/fedora-package-x64/pkg-src/README.md diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin-firewalld.xml b/deployment/old/fedora-package-x64/pkg-src/jellyfin-firewalld.xml similarity index 100% rename from deployment/fedora-package-x64/pkg-src/jellyfin-firewalld.xml rename to deployment/old/fedora-package-x64/pkg-src/jellyfin-firewalld.xml diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin.env b/deployment/old/fedora-package-x64/pkg-src/jellyfin.env similarity index 100% rename from deployment/fedora-package-x64/pkg-src/jellyfin.env rename to deployment/old/fedora-package-x64/pkg-src/jellyfin.env diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin.override.conf b/deployment/old/fedora-package-x64/pkg-src/jellyfin.override.conf similarity index 100% rename from deployment/fedora-package-x64/pkg-src/jellyfin.override.conf rename to deployment/old/fedora-package-x64/pkg-src/jellyfin.override.conf diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin.service b/deployment/old/fedora-package-x64/pkg-src/jellyfin.service similarity index 100% rename from deployment/fedora-package-x64/pkg-src/jellyfin.service rename to deployment/old/fedora-package-x64/pkg-src/jellyfin.service diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin.spec b/deployment/old/fedora-package-x64/pkg-src/jellyfin.spec similarity index 100% rename from deployment/fedora-package-x64/pkg-src/jellyfin.spec rename to deployment/old/fedora-package-x64/pkg-src/jellyfin.spec diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin.sudoers b/deployment/old/fedora-package-x64/pkg-src/jellyfin.sudoers similarity index 100% rename from deployment/fedora-package-x64/pkg-src/jellyfin.sudoers rename to deployment/old/fedora-package-x64/pkg-src/jellyfin.sudoers diff --git a/deployment/debian-package-x64/pkg-src/bin/restart.sh b/deployment/old/fedora-package-x64/pkg-src/restart.sh similarity index 100% rename from deployment/debian-package-x64/pkg-src/bin/restart.sh rename to deployment/old/fedora-package-x64/pkg-src/restart.sh diff --git a/deployment/linux-x64/Dockerfile b/deployment/old/linux-x64/Dockerfile similarity index 100% rename from deployment/linux-x64/Dockerfile rename to deployment/old/linux-x64/Dockerfile diff --git a/deployment/linux-x64/clean.sh b/deployment/old/linux-x64/clean.sh similarity index 100% rename from deployment/linux-x64/clean.sh rename to deployment/old/linux-x64/clean.sh diff --git a/deployment/linux-x64/dependencies.txt b/deployment/old/linux-x64/dependencies.txt similarity index 100% rename from deployment/linux-x64/dependencies.txt rename to deployment/old/linux-x64/dependencies.txt diff --git a/deployment/linux-x64/docker-build.sh b/deployment/old/linux-x64/docker-build.sh similarity index 100% rename from deployment/linux-x64/docker-build.sh rename to deployment/old/linux-x64/docker-build.sh diff --git a/deployment/linux-x64/package.sh b/deployment/old/linux-x64/package.sh similarity index 100% rename from deployment/linux-x64/package.sh rename to deployment/old/linux-x64/package.sh diff --git a/deployment/macos/Dockerfile b/deployment/old/macos/Dockerfile similarity index 100% rename from deployment/macos/Dockerfile rename to deployment/old/macos/Dockerfile diff --git a/deployment/macos/clean.sh b/deployment/old/macos/clean.sh similarity index 100% rename from deployment/macos/clean.sh rename to deployment/old/macos/clean.sh diff --git a/deployment/macos/dependencies.txt b/deployment/old/macos/dependencies.txt similarity index 100% rename from deployment/macos/dependencies.txt rename to deployment/old/macos/dependencies.txt diff --git a/deployment/macos/docker-build.sh b/deployment/old/macos/docker-build.sh similarity index 100% rename from deployment/macos/docker-build.sh rename to deployment/old/macos/docker-build.sh diff --git a/deployment/macos/package.sh b/deployment/old/macos/package.sh similarity index 100% rename from deployment/macos/package.sh rename to deployment/old/macos/package.sh diff --git a/deployment/portable/Dockerfile b/deployment/old/portable/Dockerfile similarity index 100% rename from deployment/portable/Dockerfile rename to deployment/old/portable/Dockerfile diff --git a/deployment/portable/clean.sh b/deployment/old/portable/clean.sh similarity index 100% rename from deployment/portable/clean.sh rename to deployment/old/portable/clean.sh diff --git a/deployment/portable/dependencies.txt b/deployment/old/portable/dependencies.txt similarity index 100% rename from deployment/portable/dependencies.txt rename to deployment/old/portable/dependencies.txt diff --git a/deployment/portable/docker-build.sh b/deployment/old/portable/docker-build.sh similarity index 100% rename from deployment/portable/docker-build.sh rename to deployment/old/portable/docker-build.sh diff --git a/deployment/portable/package.sh b/deployment/old/portable/package.sh similarity index 100% rename from deployment/portable/package.sh rename to deployment/old/portable/package.sh diff --git a/deployment/ubuntu-package-arm64/Dockerfile.amd64 b/deployment/old/ubuntu-package-arm64/Dockerfile.amd64 similarity index 100% rename from deployment/ubuntu-package-arm64/Dockerfile.amd64 rename to deployment/old/ubuntu-package-arm64/Dockerfile.amd64 diff --git a/deployment/ubuntu-package-arm64/Dockerfile.arm64 b/deployment/old/ubuntu-package-arm64/Dockerfile.arm64 similarity index 100% rename from deployment/ubuntu-package-arm64/Dockerfile.arm64 rename to deployment/old/ubuntu-package-arm64/Dockerfile.arm64 diff --git a/deployment/ubuntu-package-arm64/clean.sh b/deployment/old/ubuntu-package-arm64/clean.sh similarity index 100% rename from deployment/ubuntu-package-arm64/clean.sh rename to deployment/old/ubuntu-package-arm64/clean.sh diff --git a/deployment/ubuntu-package-arm64/dependencies.txt b/deployment/old/ubuntu-package-arm64/dependencies.txt similarity index 100% rename from deployment/ubuntu-package-arm64/dependencies.txt rename to deployment/old/ubuntu-package-arm64/dependencies.txt diff --git a/deployment/ubuntu-package-arm64/docker-build.sh b/deployment/old/ubuntu-package-arm64/docker-build.sh similarity index 100% rename from deployment/ubuntu-package-arm64/docker-build.sh rename to deployment/old/ubuntu-package-arm64/docker-build.sh diff --git a/deployment/ubuntu-package-arm64/package.sh b/deployment/old/ubuntu-package-arm64/package.sh similarity index 100% rename from deployment/ubuntu-package-arm64/package.sh rename to deployment/old/ubuntu-package-arm64/package.sh diff --git a/deployment/ubuntu-package-arm64/pkg-src b/deployment/old/ubuntu-package-arm64/pkg-src similarity index 100% rename from deployment/ubuntu-package-arm64/pkg-src rename to deployment/old/ubuntu-package-arm64/pkg-src diff --git a/deployment/ubuntu-package-armhf/Dockerfile.amd64 b/deployment/old/ubuntu-package-armhf/Dockerfile.amd64 similarity index 100% rename from deployment/ubuntu-package-armhf/Dockerfile.amd64 rename to deployment/old/ubuntu-package-armhf/Dockerfile.amd64 diff --git a/deployment/ubuntu-package-armhf/Dockerfile.armhf b/deployment/old/ubuntu-package-armhf/Dockerfile.armhf similarity index 100% rename from deployment/ubuntu-package-armhf/Dockerfile.armhf rename to deployment/old/ubuntu-package-armhf/Dockerfile.armhf diff --git a/deployment/ubuntu-package-armhf/clean.sh b/deployment/old/ubuntu-package-armhf/clean.sh similarity index 100% rename from deployment/ubuntu-package-armhf/clean.sh rename to deployment/old/ubuntu-package-armhf/clean.sh diff --git a/deployment/ubuntu-package-armhf/dependencies.txt b/deployment/old/ubuntu-package-armhf/dependencies.txt similarity index 100% rename from deployment/ubuntu-package-armhf/dependencies.txt rename to deployment/old/ubuntu-package-armhf/dependencies.txt diff --git a/deployment/ubuntu-package-armhf/docker-build.sh b/deployment/old/ubuntu-package-armhf/docker-build.sh similarity index 100% rename from deployment/ubuntu-package-armhf/docker-build.sh rename to deployment/old/ubuntu-package-armhf/docker-build.sh diff --git a/deployment/ubuntu-package-armhf/package.sh b/deployment/old/ubuntu-package-armhf/package.sh similarity index 100% rename from deployment/ubuntu-package-armhf/package.sh rename to deployment/old/ubuntu-package-armhf/package.sh diff --git a/deployment/ubuntu-package-armhf/pkg-src b/deployment/old/ubuntu-package-armhf/pkg-src similarity index 100% rename from deployment/ubuntu-package-armhf/pkg-src rename to deployment/old/ubuntu-package-armhf/pkg-src diff --git a/deployment/ubuntu-package-x64/Dockerfile b/deployment/old/ubuntu-package-x64/Dockerfile similarity index 100% rename from deployment/ubuntu-package-x64/Dockerfile rename to deployment/old/ubuntu-package-x64/Dockerfile diff --git a/deployment/ubuntu-package-x64/clean.sh b/deployment/old/ubuntu-package-x64/clean.sh similarity index 100% rename from deployment/ubuntu-package-x64/clean.sh rename to deployment/old/ubuntu-package-x64/clean.sh diff --git a/deployment/ubuntu-package-x64/dependencies.txt b/deployment/old/ubuntu-package-x64/dependencies.txt similarity index 100% rename from deployment/ubuntu-package-x64/dependencies.txt rename to deployment/old/ubuntu-package-x64/dependencies.txt diff --git a/deployment/ubuntu-package-x64/docker-build.sh b/deployment/old/ubuntu-package-x64/docker-build.sh similarity index 100% rename from deployment/ubuntu-package-x64/docker-build.sh rename to deployment/old/ubuntu-package-x64/docker-build.sh diff --git a/deployment/ubuntu-package-x64/package.sh b/deployment/old/ubuntu-package-x64/package.sh similarity index 100% rename from deployment/ubuntu-package-x64/package.sh rename to deployment/old/ubuntu-package-x64/package.sh diff --git a/deployment/ubuntu-package-x64/pkg-src b/deployment/old/ubuntu-package-x64/pkg-src similarity index 100% rename from deployment/ubuntu-package-x64/pkg-src rename to deployment/old/ubuntu-package-x64/pkg-src diff --git a/deployment/unraid/docker-templates/README.md b/deployment/old/unraid/docker-templates/README.md similarity index 100% rename from deployment/unraid/docker-templates/README.md rename to deployment/old/unraid/docker-templates/README.md diff --git a/deployment/unraid/docker-templates/jellyfin.xml b/deployment/old/unraid/docker-templates/jellyfin.xml similarity index 100% rename from deployment/unraid/docker-templates/jellyfin.xml rename to deployment/old/unraid/docker-templates/jellyfin.xml diff --git a/deployment/win-x64/Dockerfile b/deployment/old/win-x64/Dockerfile similarity index 100% rename from deployment/win-x64/Dockerfile rename to deployment/old/win-x64/Dockerfile diff --git a/deployment/win-x64/clean.sh b/deployment/old/win-x64/clean.sh similarity index 100% rename from deployment/win-x64/clean.sh rename to deployment/old/win-x64/clean.sh diff --git a/deployment/win-x64/dependencies.txt b/deployment/old/win-x64/dependencies.txt similarity index 100% rename from deployment/win-x64/dependencies.txt rename to deployment/old/win-x64/dependencies.txt diff --git a/deployment/win-x64/docker-build.sh b/deployment/old/win-x64/docker-build.sh similarity index 100% rename from deployment/win-x64/docker-build.sh rename to deployment/old/win-x64/docker-build.sh diff --git a/deployment/win-x64/package.sh b/deployment/old/win-x64/package.sh similarity index 100% rename from deployment/win-x64/package.sh rename to deployment/old/win-x64/package.sh diff --git a/deployment/win-x86/Dockerfile b/deployment/old/win-x86/Dockerfile similarity index 100% rename from deployment/win-x86/Dockerfile rename to deployment/old/win-x86/Dockerfile diff --git a/deployment/win-x86/clean.sh b/deployment/old/win-x86/clean.sh similarity index 100% rename from deployment/win-x86/clean.sh rename to deployment/old/win-x86/clean.sh diff --git a/deployment/win-x86/dependencies.txt b/deployment/old/win-x86/dependencies.txt similarity index 100% rename from deployment/win-x86/dependencies.txt rename to deployment/old/win-x86/dependencies.txt diff --git a/deployment/win-x86/docker-build.sh b/deployment/old/win-x86/docker-build.sh similarity index 100% rename from deployment/win-x86/docker-build.sh rename to deployment/old/win-x86/docker-build.sh diff --git a/deployment/win-x86/package.sh b/deployment/old/win-x86/package.sh similarity index 100% rename from deployment/win-x86/package.sh rename to deployment/old/win-x86/package.sh diff --git a/deployment/windows/build-jellyfin.ps1 b/deployment/old/windows/build-jellyfin.ps1 similarity index 100% rename from deployment/windows/build-jellyfin.ps1 rename to deployment/old/windows/build-jellyfin.ps1 diff --git a/deployment/windows/dependencies.txt b/deployment/old/windows/dependencies.txt similarity index 100% rename from deployment/windows/dependencies.txt rename to deployment/old/windows/dependencies.txt diff --git a/deployment/windows/dialogs/confirmation.nsddef b/deployment/old/windows/dialogs/confirmation.nsddef similarity index 100% rename from deployment/windows/dialogs/confirmation.nsddef rename to deployment/old/windows/dialogs/confirmation.nsddef diff --git a/deployment/windows/dialogs/confirmation.nsdinc b/deployment/old/windows/dialogs/confirmation.nsdinc similarity index 100% rename from deployment/windows/dialogs/confirmation.nsdinc rename to deployment/old/windows/dialogs/confirmation.nsdinc diff --git a/deployment/windows/dialogs/service-config.nsddef b/deployment/old/windows/dialogs/service-config.nsddef similarity index 100% rename from deployment/windows/dialogs/service-config.nsddef rename to deployment/old/windows/dialogs/service-config.nsddef diff --git a/deployment/windows/dialogs/service-config.nsdinc b/deployment/old/windows/dialogs/service-config.nsdinc similarity index 100% rename from deployment/windows/dialogs/service-config.nsdinc rename to deployment/old/windows/dialogs/service-config.nsdinc diff --git a/deployment/windows/dialogs/setuptype.nsddef b/deployment/old/windows/dialogs/setuptype.nsddef similarity index 100% rename from deployment/windows/dialogs/setuptype.nsddef rename to deployment/old/windows/dialogs/setuptype.nsddef diff --git a/deployment/windows/dialogs/setuptype.nsdinc b/deployment/old/windows/dialogs/setuptype.nsdinc similarity index 100% rename from deployment/windows/dialogs/setuptype.nsdinc rename to deployment/old/windows/dialogs/setuptype.nsdinc diff --git a/deployment/windows/helpers/ShowError.nsh b/deployment/old/windows/helpers/ShowError.nsh similarity index 100% rename from deployment/windows/helpers/ShowError.nsh rename to deployment/old/windows/helpers/ShowError.nsh diff --git a/deployment/windows/helpers/StrSlash.nsh b/deployment/old/windows/helpers/StrSlash.nsh similarity index 100% rename from deployment/windows/helpers/StrSlash.nsh rename to deployment/old/windows/helpers/StrSlash.nsh diff --git a/deployment/windows/jellyfin.nsi b/deployment/old/windows/jellyfin.nsi similarity index 100% rename from deployment/windows/jellyfin.nsi rename to deployment/old/windows/jellyfin.nsi diff --git a/deployment/windows/legacy/install-jellyfin.ps1 b/deployment/old/windows/legacy/install-jellyfin.ps1 similarity index 100% rename from deployment/windows/legacy/install-jellyfin.ps1 rename to deployment/old/windows/legacy/install-jellyfin.ps1 diff --git a/deployment/windows/legacy/install.bat b/deployment/old/windows/legacy/install.bat similarity index 100% rename from deployment/windows/legacy/install.bat rename to deployment/old/windows/legacy/install.bat From 8b620ed26addec0f42e2797e3e4d45fbd68b0f23 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 22 Mar 2020 16:01:33 -0400 Subject: [PATCH 007/115] Move Debian folder to root of repo --- debian/changelog | 59 ++++++++++++++++++++ debian/compat | 1 + debian/conf/jellyfin | 40 ++++++++++++++ debian/conf/jellyfin-sudoers | 37 +++++++++++++ debian/conf/jellyfin.service.conf | 7 +++ debian/conf/logging.json | 30 ++++++++++ debian/control | 31 +++++++++++ debian/copyright | 29 ++++++++++ debian/gbp.conf | 6 ++ debian/install | 6 ++ debian/jellyfin.init | 61 ++++++++++++++++++++ debian/jellyfin.service | 14 +++++ debian/jellyfin.upstart | 20 +++++++ debian/po/POTFILES.in | 1 + debian/po/templates.pot | 57 +++++++++++++++++++ debian/postinst | 92 +++++++++++++++++++++++++++++++ debian/postrm | 81 +++++++++++++++++++++++++++ debian/preinst | 78 ++++++++++++++++++++++++++ debian/prerm | 61 ++++++++++++++++++++ debian/rules | 66 ++++++++++++++++++++++ debian/source.lintian-overrides | 3 + debian/source/format | 1 + debian/source/options | 11 ++++ 23 files changed, 792 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/conf/jellyfin create mode 100644 debian/conf/jellyfin-sudoers create mode 100644 debian/conf/jellyfin.service.conf create mode 100644 debian/conf/logging.json create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/gbp.conf create mode 100644 debian/install create mode 100644 debian/jellyfin.init create mode 100644 debian/jellyfin.service create mode 100644 debian/jellyfin.upstart create mode 100644 debian/po/POTFILES.in create mode 100644 debian/po/templates.pot create mode 100644 debian/postinst create mode 100644 debian/postrm create mode 100644 debian/preinst create mode 100644 debian/prerm create mode 100755 debian/rules create mode 100644 debian/source.lintian-overrides create mode 100644 debian/source/format create mode 100644 debian/source/options diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000000..51c4822370 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,59 @@ +jellyfin (10.5.0-1) unstable; urgency=medium + + * New upstream version 10.5.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.5.0 + + -- Jellyfin Packaging Team Fri, 11 Oct 2019 20:12:38 -0400 + +jellyfin (10.4.0-1) unstable; urgency=medium + + * New upstream version 10.4.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.4.0 + + -- Jellyfin Packaging Team Sat, 31 Aug 2019 21:38:56 -0400 + +jellyfin (10.3.7-1) unstable; urgency=medium + + * New upstream version 10.3.7; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.7 + + -- Jellyfin Packaging Team Wed, 24 Jul 2019 10:48:28 -0400 + +jellyfin (10.3.6-1) unstable; urgency=medium + + * New upstream version 10.3.6; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.6 + + -- Jellyfin Packaging Team Sat, 06 Jul 2019 13:34:19 -0400 + +jellyfin (10.3.5-1) unstable; urgency=medium + + * New upstream version 10.3.5; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.5 + + -- Jellyfin Packaging Team Sun, 09 Jun 2019 21:47:35 -0400 + +jellyfin (10.3.4-1) unstable; urgency=medium + + * New upstream version 10.3.4; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.4 + + -- Jellyfin Packaging Team Thu, 06 Jun 2019 22:45:31 -0400 + +jellyfin (10.3.3-1) unstable; urgency=medium + + * New upstream version 10.3.3; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.3 + + -- Jellyfin Packaging Team Fri, 17 May 2019 23:12:08 -0400 + +jellyfin (10.3.2-1) unstable; urgency=medium + + * New upstream version 10.3.2; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.2 + + -- Jellyfin Packaging Team Tue, 30 Apr 2019 20:18:44 -0400 + +jellyfin (10.3.1-1) unstable; urgency=medium + + * New upstream version 10.3.1; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.1 + + -- Jellyfin Packaging Team Sat, 20 Apr 2019 14:24:07 -0400 + +jellyfin (10.3.0-1) unstable; urgency=medium + + * New upstream version 10.3.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.0 + + -- Jellyfin Packaging Team Fri, 19 Apr 2019 14:24:29 -0400 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000000..45a4fb75db --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +8 diff --git a/debian/conf/jellyfin b/debian/conf/jellyfin new file mode 100644 index 0000000000..c6e595f15a --- /dev/null +++ b/debian/conf/jellyfin @@ -0,0 +1,40 @@ +# Jellyfin default configuration options +# This is a POSIX shell fragment + +# Use this file to override the default configurations; add additional +# options with JELLYFIN_ADD_OPTS. + +# Under systemd, use +# /etc/systemd/system/jellyfin.service.d/jellyfin.service.conf +# to override the user or this config file's location. + +# +# General options +# + +# Program directories +JELLYFIN_DATA_DIR="/var/lib/jellyfin" +JELLYFIN_CONFIG_DIR="/etc/jellyfin" +JELLYFIN_LOG_DIR="/var/log/jellyfin" +JELLYFIN_CACHE_DIR="/var/cache/jellyfin" + +# Restart script for in-app server control +JELLYFIN_RESTART_OPT="--restartpath=/usr/lib/jellyfin/restart.sh" + +# ffmpeg binary paths, overriding the system values +JELLYFIN_FFMPEG_OPT="--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg" + +# [OPTIONAL] run Jellyfin as a headless service +#JELLYFIN_SERVICE_OPT="--service" + +# [OPTIONAL] run Jellyfin without the web app +#JELLYFIN_NOWEBAPP_OPT="--noautorunwebapp" + +# +# SysV init/Upstart options +# + +# Application username +JELLYFIN_USER="jellyfin" +# Full application command +JELLYFIN_ARGS="$JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLFIN_NOWEBAPP_OPT" diff --git a/debian/conf/jellyfin-sudoers b/debian/conf/jellyfin-sudoers new file mode 100644 index 0000000000..b481ba4ad4 --- /dev/null +++ b/debian/conf/jellyfin-sudoers @@ -0,0 +1,37 @@ +#Allow jellyfin group to start, stop and restart itself +Cmnd_Alias RESTARTSERVER_SYSV = /sbin/service jellyfin restart, /usr/sbin/service jellyfin restart +Cmnd_Alias STARTSERVER_SYSV = /sbin/service jellyfin start, /usr/sbin/service jellyfin start +Cmnd_Alias STOPSERVER_SYSV = /sbin/service jellyfin stop, /usr/sbin/service jellyfin stop +Cmnd_Alias RESTARTSERVER_SYSTEMD = /usr/bin/systemctl restart jellyfin, /bin/systemctl restart jellyfin +Cmnd_Alias STARTSERVER_SYSTEMD = /usr/bin/systemctl start jellyfin, /bin/systemctl start jellyfin +Cmnd_Alias STOPSERVER_SYSTEMD = /usr/bin/systemctl stop jellyfin, /bin/systemctl stop jellyfin +Cmnd_Alias RESTARTSERVER_INITD = /etc/init.d/jellyfin restart +Cmnd_Alias STARTSERVER_INITD = /etc/init.d/jellyfin start +Cmnd_Alias STOPSERVER_INITD = /etc/init.d/jellyfin stop + + +jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSV +jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSV +jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSV +jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSTEMD +jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSTEMD +jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSTEMD +jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_INITD +jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_INITD +jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_INITD + +Defaults!RESTARTSERVER_SYSV !requiretty +Defaults!STARTSERVER_SYSV !requiretty +Defaults!STOPSERVER_SYSV !requiretty +Defaults!RESTARTSERVER_SYSTEMD !requiretty +Defaults!STARTSERVER_SYSTEMD !requiretty +Defaults!STOPSERVER_SYSTEMD !requiretty +Defaults!RESTARTSERVER_INITD !requiretty +Defaults!STARTSERVER_INITD !requiretty +Defaults!STOPSERVER_INITD !requiretty + +#Allow the server to mount iso images +jellyfin ALL=(ALL) NOPASSWD: /bin/mount +jellyfin ALL=(ALL) NOPASSWD: /bin/umount + +Defaults:jellyfin !requiretty diff --git a/debian/conf/jellyfin.service.conf b/debian/conf/jellyfin.service.conf new file mode 100644 index 0000000000..1b69dd74ef --- /dev/null +++ b/debian/conf/jellyfin.service.conf @@ -0,0 +1,7 @@ +# Jellyfin systemd configuration options + +# Use this file to override the user or environment file location. + +[Service] +#User = jellyfin +#EnvironmentFile = /etc/default/jellyfin diff --git a/debian/conf/logging.json b/debian/conf/logging.json new file mode 100644 index 0000000000..f32b2089eb --- /dev/null +++ b/debian/conf/logging.json @@ -0,0 +1,30 @@ +{ + "Serilog": { + "MinimumLevel": "Information", + "WriteTo": [ + { + "Name": "Console", + "Args": { + "outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "Async", + "Args": { + "configure": [ + { + "Name": "File", + "Args": { + "path": "%JELLYFIN_LOG_DIR%//jellyfin.log", + "fileSizeLimitBytes": 10485700, + "rollOnFileSizeLimit": true, + "retainedFileCountLimit": 10, + "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}" + } + } + ] + } + } + ] + } +} diff --git a/debian/control b/debian/control new file mode 100644 index 0000000000..13fd3ecabb --- /dev/null +++ b/debian/control @@ -0,0 +1,31 @@ +Source: jellyfin +Section: misc +Priority: optional +Maintainer: Jellyfin Team +Build-Depends: debhelper (>= 9), + dotnet-sdk-3.1, + libc6-dev, + libcurl4-openssl-dev, + libfontconfig1-dev, + libfreetype6-dev, + libssl-dev, + wget, + npm | nodejs +Standards-Version: 3.9.4 +Homepage: https://jellyfin.media/ +Vcs-Git: https://github.org/jellyfin/jellyfin.git +Vcs-Browser: https://github.org/jellyfin/jellyfin + +Package: jellyfin +Replaces: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server +Breaks: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server +Conflicts: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server +Architecture: any +Depends: at, + libsqlite3-0, + jellyfin-ffmpeg, + libfontconfig1, + libfreetype6, + libssl1.1 +Description: Jellyfin is a home media server. + It is built on top of other popular open source technologies such as Service Stack, jQuery, jQuery mobile, and Mono. It features a REST-based api with built-in documentation to facilitate client development. We also have client libraries for our api to enable rapid development. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000000..0d7a2a6007 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,29 @@ +Format: http://dep.debian.net/deps/dep5 +Upstream-Name: jellyfin +Source: https://github.com/jellyfin/jellyfin + +Files: * +Copyright: 2018 Jellyfin Team +License: GPL-2.0+ + +Files: debian/* +Copyright: 2018 Joshua Boniface +Copyright: 2014 Carlos Hernandez +License: GPL-2.0+ + +License: GPL-2.0+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000000..60b3d28723 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,6 @@ +[DEFAULT] +pristine-tar = False +cleaner = fakeroot debian/rules clean + +[import-orig] +filter = [ ".git*", ".hg*", ".vs*", ".vscode*" ] diff --git a/debian/install b/debian/install new file mode 100644 index 0000000000..994322d141 --- /dev/null +++ b/debian/install @@ -0,0 +1,6 @@ +usr/lib/jellyfin usr/lib/ +debian/conf/jellyfin etc/default/ +debian/conf/logging.json etc/jellyfin/ +debian/conf/jellyfin.service.conf etc/systemd/system/jellyfin.service.d/ +debian/conf/jellyfin-sudoers etc/sudoers.d/ +debian/bin/restart.sh usr/lib/jellyfin/ diff --git a/debian/jellyfin.init b/debian/jellyfin.init new file mode 100644 index 0000000000..7f5642bac1 --- /dev/null +++ b/debian/jellyfin.init @@ -0,0 +1,61 @@ +### BEGIN INIT INFO +# Provides: Jellyfin Media Server +# Required-Start: $local_fs $network +# Required-Stop: $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Jellyfin Media Server +# Description: Runs Jellyfin Server +### END INIT INFO + +set -e + +# Carry out specific functions when asked to by the system + +if test -f /etc/default/jellyfin; then + . /etc/default/jellyfin +fi + +. /lib/lsb/init-functions + +PIDFILE="/run/jellyfin.pid" + +case "$1" in + start) + log_daemon_msg "Starting Jellyfin Media Server" "jellyfin" || true + + if start-stop-daemon --start --quiet --oknodo --background --pidfile $PIDFILE --make-pidfile --user $JELLYFIN_USER --chuid $JELLYFIN_USER --exec /usr/bin/jellyfin -- $JELLYFIN_ARGS; then + log_end_msg 0 || true + else + log_end_msg 1 || true + fi + ;; + + stop) + log_daemon_msg "Stopping Jellyfin Media Server" "jellyfin" || true + if start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --remove-pidfile; then + log_end_msg 0 || true + else + log_end_msg 1 || true + fi + ;; + + restart) + log_daemon_msg "Restarting Jellyfin Media Server" "jellyfin" || true + start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PIDFILE --remove-pidfile + if start-stop-daemon --start --quiet --oknodo --background --pidfile $PIDFILE --make-pidfile --user $JELLYFIN_USER --chuid $JELLYFIN_USER --exec /usr/bin/jellyfin -- $JELLYFIN_ARGS; then + log_end_msg 0 || true + else + log_end_msg 1 || true + fi + ;; + + status) + status_of_proc -p $PIDFILE /usr/bin/jellyfin jellyfin && exit 0 || exit $? + ;; + + *) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac diff --git a/debian/jellyfin.service b/debian/jellyfin.service new file mode 100644 index 0000000000..1305e238b0 --- /dev/null +++ b/debian/jellyfin.service @@ -0,0 +1,14 @@ +[Unit] +Description = Jellyfin Media Server +After = network.target + +[Service] +Type = simple +EnvironmentFile = /etc/default/jellyfin +User = jellyfin +ExecStart = /usr/bin/jellyfin ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT} +Restart = on-failure +TimeoutSec = 15 + +[Install] +WantedBy = multi-user.target diff --git a/debian/jellyfin.upstart b/debian/jellyfin.upstart new file mode 100644 index 0000000000..ef5bc9bcaf --- /dev/null +++ b/debian/jellyfin.upstart @@ -0,0 +1,20 @@ +description "jellyfin daemon" + +start on (local-filesystems and net-device-up IFACE!=lo) +stop on runlevel [!2345] + +console log +respawn +respawn limit 10 5 + +kill timeout 20 + +script + set -x + echo "Starting $UPSTART_JOB" + + # Log file + logger -t "$0" "DEBUG: `set`" + . /etc/default/jellyfin + exec su -u $JELLYFIN_USER -c /usr/bin/jellyfin $JELLYFIN_ARGS +end script diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in new file mode 100644 index 0000000000..cef83a3407 --- /dev/null +++ b/debian/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] templates diff --git a/debian/po/templates.pot b/debian/po/templates.pot new file mode 100644 index 0000000000..2cdcae4173 --- /dev/null +++ b/debian/po/templates.pot @@ -0,0 +1,57 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: jellyfin-server\n" +"Report-Msgid-Bugs-To: jellyfin-server@packages.debian.org\n" +"POT-Creation-Date: 2015-06-12 20:51-0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "Jellyfin permission info:" +msgstr "" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"Jellyfin by default runs under a user named \"jellyfin\". Please ensure that the " +"user jellyfin has read and write access to any folders you wish to add to your " +"library. Otherwise please run jellyfin under a different user." +msgstr "" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Username to run Jellyfin as:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "The user that jellyfin will run as." +msgstr "" + +#. Type: note +#. Description +#: ../templates:3001 +msgid "Jellyfin still running" +msgstr "" + +#. Type: note +#. Description +#: ../templates:3001 +msgid "Jellyfin is currently running. Please close it and try again." +msgstr "" diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000000..860222e051 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,92 @@ +#!/bin/bash +set -e + +NAME=jellyfin +DEFAULT_FILE=/etc/default/${NAME} + +# Source Jellyfin default configuration +if [[ -f $DEFAULT_FILE ]]; then + . $DEFAULT_FILE +fi + +# Data directories for program data (cache, db), configs, and logs +PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} +CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} +LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} +CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} + +case "$1" in + configure) + # create jellyfin group if it does not exist + if [[ -z "$(getent group jellyfin)" ]]; then + addgroup --quiet --system jellyfin > /dev/null 2>&1 + fi + # create jellyfin user if it does not exist + if [[ -z "$(getent passwd jellyfin)" ]]; then + adduser --system --ingroup jellyfin --shell /bin/false jellyfin --no-create-home --home ${PROGRAMDATA} \ + --gecos "Jellyfin default user" > /dev/null 2>&1 + fi + # ensure $PROGRAMDATA exists + if [[ ! -d $PROGRAMDATA ]]; then + mkdir $PROGRAMDATA + fi + # ensure $CONFIGDATA exists + if [[ ! -d $CONFIGDATA ]]; then + mkdir $CONFIGDATA + fi + # ensure $LOGDATA exists + if [[ ! -d $LOGDATA ]]; then + mkdir $LOGDATA + fi + # ensure $CACHEDATA exists + if [[ ! -d $CACHEDATA ]]; then + mkdir $CACHEDATA + fi + # Ensure permissions are correct on all config directories + chown -R jellyfin $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA + chgrp adm $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA + chmod 0750 $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA + + chmod +x /usr/lib/jellyfin/restart.sh > /dev/null 2>&1 || true + + # Install jellyfin symlink into /usr/bin + ln -sf /usr/lib/jellyfin/bin/jellyfin /usr/bin/jellyfin + + ;; + abort-upgrade|abort-remove|abort-deconfigure) + ;; + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER + +if [[ -x "/usr/bin/deb-systemd-helper" ]]; then + # Manual init script handling + deb-systemd-helper unmask jellyfin.service >/dev/null || true + # was-enabled defaults to true, so new installations run enable. + if deb-systemd-helper --quiet was-enabled jellyfin.service; then + # Enables the unit on first installation, creates new + # symlinks on upgrades if the unit file has changed. + deb-systemd-helper enable jellyfin.service >/dev/null || true + else + # Update the statefile to add new symlinks (if any), which need to be + # cleaned up on purge. Also remove old symlinks. + deb-systemd-helper update-state jellyfin.service >/dev/null || true + fi +fi + +# End automatically added section +# Automatically added by dh_installinit +if [[ "$1" == "configure" ]] || [[ "$1" == "abort-upgrade" ]]; then + if [[ -d "/run/systemd/systemd" ]]; then + systemctl --system daemon-reload >/dev/null || true + deb-systemd-invoke start jellyfin >/dev/null || true + elif [[ -x "/etc/init.d/jellyfin" ]] || [[ -e "/etc/init/jellyfin.conf" ]]; then + update-rc.d jellyfin defaults >/dev/null + invoke-rc.d jellyfin start || exit $? + fi +fi +exit 0 diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000000..1d00a984ec --- /dev/null +++ b/debian/postrm @@ -0,0 +1,81 @@ +#!/bin/bash +set -e + +NAME=jellyfin +DEFAULT_FILE=/etc/default/${NAME} + +# Source Jellyfin default configuration +if [[ -f $DEFAULT_FILE ]]; then + . $DEFAULT_FILE +fi + +# Data directories for program data (cache, db), configs, and logs +PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} +CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} +LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} +CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} + +# In case this system is running systemd, we make systemd reload the unit files +# to pick up changes. +if [[ -d /run/systemd/system ]] ; then + systemctl --system daemon-reload >/dev/null || true +fi + +case "$1" in + purge) + echo PURGE | debconf-communicate $NAME > /dev/null 2>&1 || true + + if [[ -x "/etc/init.d/jellyfin" ]] || [[ -e "/etc/init/jellyfin.connf" ]]; then + update-rc.d jellyfin remove >/dev/null 2>&1 || true + fi + + if [[ -x "/usr/bin/deb-systemd-helper" ]]; then + deb-systemd-helper purge jellyfin.service >/dev/null + deb-systemd-helper unmask jellyfin.service >/dev/null + fi + + # Remove user and group + userdel jellyfin > /dev/null 2>&1 || true + delgroup --quiet jellyfin > /dev/null 2>&1 || true + # Remove config dir + if [[ -d $CONFIGDATA ]]; then + rm -rf $CONFIGDATA + fi + # Remove log dir + if [[ -d $LOGDATA ]]; then + rm -rf $LOGDATA + fi + # Remove cache dir + if [[ -d $CACHEDATA ]]; then + rm -rf $CACHEDATA + fi + # Remove program data dir + if [[ -d $PROGRAMDATA ]]; then + rm -rf $PROGRAMDATA + fi + # Remove binary symlink + [[ -f /usr/bin/jellyfin ]] && rm /usr/bin/jellyfin + # Remove sudoers config + [[ -f /etc/sudoers.d/jellyfin-sudoers ]] && rm /etc/sudoers.d/jellyfin-sudoers + # Remove anything at the default locations; catches situations where the user moved the defaults + [[ -e /etc/jellyfin ]] && rm -rf /etc/jellyfin + [[ -e /var/log/jellyfin ]] && rm -rf /var/log/jellyfin + [[ -e /var/cache/jellyfin ]] && rm -rf /var/cache/jellyfin + [[ -e /var/lib/jellyfin ]] && rm -rf /var/lib/jellyfin + ;; + remove) + if [[ -x "/usr/bin/deb-systemd-helper" ]]; then + deb-systemd-helper mask jellyfin.service >/dev/null + fi + ;; + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/preinst b/debian/preinst new file mode 100644 index 0000000000..2713fb9b80 --- /dev/null +++ b/debian/preinst @@ -0,0 +1,78 @@ +#!/bin/bash +set -e + +NAME=jellyfin +DEFAULT_FILE=/etc/default/${NAME} + +# Source Jellyfin default configuration +if [[ -f $DEFAULT_FILE ]]; then + . $DEFAULT_FILE +fi + +# Data directories for program data (cache, db), configs, and logs +PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} +CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} +LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} +CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} + +# In case this system is running systemd, we make systemd reload the unit files +# to pick up changes. +if [[ -d /run/systemd/system ]] ; then + systemctl --system daemon-reload >/dev/null || true +fi + +case "$1" in + install|upgrade) + # try graceful termination; + if [[ -d /run/systemd/system ]]; then + deb-systemd-invoke stop ${NAME}.service > /dev/null 2>&1 || true + elif [ -x "/etc/init.d/${NAME}" ] || [ -e "/etc/init/${NAME}.conf" ]; then + invoke-rc.d ${NAME} stop > /dev/null 2>&1 || true + fi + # try and figure out if jellyfin is running + PIDFILE=$(find /var/run/ -maxdepth 1 -mindepth 1 -name "jellyfin*.pid" -print -quit) + [[ -n "$PIDFILE" ]] && [[ -s "$PIDFILE" ]] && JELLYFIN_PID=$(cat ${PIDFILE}) + # if its running, let's stop it + if [[ -n "$JELLYFIN_PID" ]]; then + echo "Stopping Jellyfin!" + # if jellyfin is still running, kill it + if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then + CPIDS=$(pgrep -P $JELLYFIN_PID) + sleep 2 && kill -KILL $CPIDS + kill -TERM $CPIDS > /dev/null 2>&1 + fi + sleep 1 + # if it's still running, show error + if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then + echo "Could not successfully stop JellyfinServer, please do so before uninstalling." + exit 1 + else + [[ -f $PIDFILE ]] && rm $PIDFILE + fi + fi + + # Clean up old Emby cruft that can break the user's system + [[ -f /etc/sudoers.d/emby ]] && rm -f /etc/sudoers.d/emby + + # If we have existing config, log, or cache dirs in /var/lib/jellyfin, move them into the right place + if [[ -d $PROGRAMDATA/config ]]; then + mv $PROGRAMDATA/config $CONFIGDATA + fi + if [[ -d $PROGRAMDATA/logs ]]; then + mv $PROGRAMDATA/logs $LOGDATA + fi + if [[ -d $PROGRAMDATA/logs ]]; then + mv $PROGRAMDATA/cache $CACHEDATA + fi + + ;; + abort-upgrade) + ;; + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac +#DEBHELPER# + +exit 0 diff --git a/debian/prerm b/debian/prerm new file mode 100644 index 0000000000..e965cb7d71 --- /dev/null +++ b/debian/prerm @@ -0,0 +1,61 @@ +#!/bin/bash +set -e + +NAME=jellyfin +DEFAULT_FILE=/etc/default/${NAME} + +# Source Jellyfin default configuration +if [[ -f $DEFAULT_FILE ]]; then + . $DEFAULT_FILE +fi + +# Data directories for program data (cache, db), configs, and logs +PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} +CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} +LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} +CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} + +case "$1" in + remove|upgrade|deconfigure) + echo "Stopping Jellyfin!" + # try graceful termination; + if [[ -d /run/systemd/system ]]; then + deb-systemd-invoke stop ${NAME}.service > /dev/null 2>&1 || true + elif [ -x "/etc/init.d/${NAME}" ] || [ -e "/etc/init/${NAME}.conf" ]; then + invoke-rc.d ${NAME} stop > /dev/null 2>&1 || true + fi + # Ensure that it is shutdown + PIDFILE=$(find /var/run/ -maxdepth 1 -mindepth 1 -name "jellyfin*.pid" -print -quit) + [[ -n "$PIDFILE" ]] && [[ -s "$PIDFILE" ]] && JELLYFIN_PID=$(cat ${PIDFILE}) + # if its running, let's stop it + if [[ -n "$JELLYFIN_PID" ]]; then + # if jellyfin is still running, kill it + if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then + CPIDS=$(pgrep -P $JELLYFIN_PID) + sleep 2 && kill -KILL $CPIDS + kill -TERM $CPIDS > /dev/null 2>&1 + fi + sleep 1 + # if it's still running, show error + if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then + echo "Could not successfully stop Jellyfin, please do so before uninstalling." + exit 1 + else + [[ -f $PIDFILE ]] && rm $PIDFILE + fi + fi + if [[ -f /usr/lib/jellyfin/bin/MediaBrowser.Server.Mono.exe.so ]]; then + rm /usr/lib/jellyfin/bin/MediaBrowser.Server.Mono.exe.so + fi + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000000..c2d57dfb22 --- /dev/null +++ b/debian/rules @@ -0,0 +1,66 @@ +#! /usr/bin/make -f +CONFIG := Release +TERM := xterm +SHELL := /bin/bash +WEB_TARGET := $(CURDIR)/MediaBrowser.WebDashboard/jellyfin-web +WEB_VERSION := $(shell sed -n -e 's/^version: "\(.*\)"/\1/p' $(CURDIR)/build.yaml) + +HOST_ARCH := $(shell arch) +BUILD_ARCH := ${DEB_HOST_MULTIARCH} +ifeq ($(HOST_ARCH),x86_64) + # Building AMD64 + DOTNETRUNTIME := debian-x64 + ifeq ($(BUILD_ARCH),arm-linux-gnueabihf) + # Cross-building ARM on AMD64 + DOTNETRUNTIME := debian-arm + endif + ifeq ($(BUILD_ARCH),aarch64-linux-gnu) + # Cross-building ARM on AMD64 + DOTNETRUNTIME := debian-arm64 + endif +endif +ifeq ($(HOST_ARCH),armv7l) + # Building ARM + DOTNETRUNTIME := debian-arm +endif +ifeq ($(HOST_ARCH),arm64) + # Building ARM + DOTNETRUNTIME := debian-arm64 +endif + +export DH_VERBOSE=1 +export DOTNET_CLI_TELEMETRY_OPTOUT=1 + +%: + dh $@ + +# disable "make check" +override_dh_auto_test: + +# disable stripping debugging symbols +override_dh_clistrip: + +override_dh_auto_build: + echo $(WEB_VERSION) + # Clone down and build Web frontend + mkdir -p $(WEB_TARGET) + wget -O web-src.tgz https://github.com/jellyfin/jellyfin-web/archive/v$(WEB_VERSION).tar.gz || wget -O web-src.tgz https://github.com/jellyfin/jellyfin-web/archive/master.tar.gz + mkdir -p $(CURDIR)/web + tar -xzf web-src.tgz -C $(CURDIR)/web/ --strip 1 + cd $(CURDIR)/web/ && npm install yarn + cd $(CURDIR)/web/ && node_modules/yarn/bin/yarn install + mv $(CURDIR)/web/dist/* $(WEB_TARGET)/ + # Build the application + dotnet publish --configuration $(CONFIG) --output='$(CURDIR)/usr/lib/jellyfin/bin' --self-contained --runtime $(DOTNETRUNTIME) \ + "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" Jellyfin.Server + +override_dh_auto_clean: + dotnet clean -maxcpucount:1 --configuration $(CONFIG) Jellyfin.Server || true + rm -f '$(CURDIR)/web-src.tgz' + rm -rf '$(CURDIR)/usr' + rm -rf '$(CURDIR)/web' + rm -rf '$(WEB_TARGET)' + +# Force the service name to jellyfin even if we're building jellyfin-nightly +override_dh_installinit: + dh_installinit --name=jellyfin diff --git a/debian/source.lintian-overrides b/debian/source.lintian-overrides new file mode 100644 index 0000000000..aeb332f13a --- /dev/null +++ b/debian/source.lintian-overrides @@ -0,0 +1,3 @@ +# This is an override for the following lintian errors: +jellyfin source: license-problem-md5sum-non-free-file Emby.Drawing/ImageMagick/fonts/webdings.ttf* +jellyfin source: source-is-missing diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000000..d3827e75a5 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +1.0 diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000000..17b5373d5e --- /dev/null +++ b/debian/source/options @@ -0,0 +1,11 @@ +tar-ignore='.git*' +tar-ignore='**/.git' +tar-ignore='**/.hg' +tar-ignore='**/.vs' +tar-ignore='**/.vscode' +tar-ignore='deployment' +tar-ignore='**/bin' +tar-ignore='**/obj' +tar-ignore='**/.nuget' +tar-ignore='*.deb' +tar-ignore='ThirdParty' From f9cecfc0fb0cbd7a75b8aace84f094a46824b705 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 22 Mar 2020 16:01:47 -0400 Subject: [PATCH 008/115] Add new build.sh script and symlink --- build | 1 + build.sh | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 120000 build create mode 100755 build.sh diff --git a/build b/build new file mode 120000 index 0000000000..c07a74de4f --- /dev/null +++ b/build @@ -0,0 +1 @@ +build.sh \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000000..b61126e11f --- /dev/null +++ b/build.sh @@ -0,0 +1,106 @@ +#!/usr/bin/env bash + +# build.sh - Build Jellyfin binary packages +# Part of the Jellyfin Project + +set -o errexit +set -o pipefail + +usage() { + echo -e "build.sh - Build Jellyfin binary packages" + echo -e "Usage:" + echo -e " $0 -t/--type -p/--platform [-k/--keep-artifacts] [-l/--list-platforms]" + echo -e "Notes:" + echo -e " * BUILD_TYPE can be one of: [native, docker] and must be specified" + echo -e " * native: Build using the build script in the host OS" + echo -e " * docker: Build using the build script in a standardized Docker container" + echo -e " * PLATFORM can be any platform shown by -l/--list-platforms and must be specified" + echo -e " * If -k/--keep-artifacts is specified, transient artifacts (e.g. Docker containers) will be" + echo -e " retained after the build is finished" + echo -e " * If -l/--list-platforms is specified, all other arguments are ignored; the script will print" + echo -e " the list of supported platforms and exit" +} + +list_platforms() { + declare -a platforms + platforms=( + $( find deployment -maxdepth 1 -mindepth 1 -type f -name "build.*" | awk -F'.' '{ $1=""; print $2 "." $3 }' ) + ) + echo -e "Valid platforms:" + echo + for platform in ${platforms[@]}; do + echo -e "* ${platform} : $( grep '^#=' deployment/build.${platform} | sed 's/^#= //' )" + done +} + +do_build_native() { + export IS_DOCKER=NO + deployment/build.${PLATFORM} +} + +do_build_docker() { + if [[ ! -f deployment/Dockerfile.${PLATFORM} ]]; then + echo "Missing Dockerfile for platform ${PLATFORM}" + exit 1 + fi + if [[ ${KEEP_ARTIFACTS} == YES ]]; then + docker_args="" + else + docker_args="--rm" + fi + + docker build . -t "jellyfin-builder.${PLATFORM}" -f deployment/Dockerfile.${PLATFORM} + mkdir -p ${ARTIFACT_DIR} + docker run $docker_args -v "${ARTIFACT_DIR}:/dist" "jellyfin-builder.${PLATFORM}" +} + +while [[ $# -gt 0 ]]; do + key="$1" + case $key in + -t|--type) + BUILD_TYPE="$2" + shift # past argument + shift # past value + ;; + -p|--platform) + PLATFORM="$2" + shift # past argument + shift # past value + ;; + -k|--keep-artifacts) + KEEP_ARTIFACTS=YES + shift # past argument + ;; + -l|--list-platforms) + list_platforms + exit 0 + ;; + -h|--help) + usage + exit 0 + ;; + *) # unknown option + echo "Unknown option $1" + usage + exit 1 + ;; + esac +done + +if [[ -z ${BUILD_TYPE} || -z ${PLATFORM} ]]; then + usage + exit 1 +fi + +export SOURCE_DIR="$( pwd )" +export ARTIFACT_DIR="${SOURCE_DIR}/../bin/${PLATFORM}" + +# Determine build type +case ${BUILD_TYPE} in + native) + do_build_native + ;; + docker) + do_build_docker + ;; +esac From 3571afece104e39c676cfdb53df9392c225380d0 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 22 Mar 2020 16:02:35 -0400 Subject: [PATCH 009/115] Ignore web artifacts --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 42243f01a8..17cf4a6277 100644 --- a/.gitignore +++ b/.gitignore @@ -271,3 +271,8 @@ dist # BenchmarkDotNet artifacts BenchmarkDotNet.Artifacts + +# Ignore web artifacts from native builds +web/ +web-src.* +MediaBrowser.WebDashboard/jellyfin-web/ From ba55ee4986fa871390e211c56fdec1b024ff617e Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 22 Mar 2020 16:03:14 -0400 Subject: [PATCH 010/115] Add first proof-of-concept deployment setup --- deployment/Dockerfile.debian.amd64 | 34 ++++++++++++++++++++++++++++++ deployment/build.debian.amd64 | 26 +++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 deployment/Dockerfile.debian.amd64 create mode 100755 deployment/build.debian.amd64 diff --git a/deployment/Dockerfile.debian.amd64 b/deployment/Dockerfile.debian.amd64 new file mode 100644 index 0000000000..eb29402194 --- /dev/null +++ b/deployment/Dockerfile.debian.amd64 @@ -0,0 +1,34 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 +ENV IS_DOCKER=YES + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Link to build script +RUN ln -sf ${SOURCE_DIR}/deployment/build.debian.amd64 /build.sh + +# Create the source dir +RUN mkdir -p ${SOURCE_DIR} + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/build.sh"] diff --git a/deployment/build.debian.amd64 b/deployment/build.debian.amd64 new file mode 100755 index 0000000000..89f8445d80 --- /dev/null +++ b/deployment/build.debian.amd64 @@ -0,0 +1,26 @@ +#!/bin/bash + +#= Debian 9+ amd64 .deb + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +if [[ ${IS_DOCKER} == YES ]]; then + # Remove build-dep for dotnet-sdk-3.1, since it's installed manually + sed -i '/dotnet-sdk-3.1,/d' debian/control +fi + +# Build DEB +dpkg-buildpackage -us -uc --pre-clean --post-clean + +mkdir -p ${ARTIFACT_DIR}/ +mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ + +if [[ ${IS_DOCKER} == YES ]]; then + chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} +fi + +popd From 93d1256a4c80c071b0c14e066c13bb9720b63dc9 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 14:46:16 -0400 Subject: [PATCH 011/115] Remove web building, rename, bump version --- debian/changelog | 6 ++++++ debian/control | 9 ++++----- debian/rules | 15 --------------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/debian/changelog b/debian/changelog index 51c4822370..35fb659571 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +jellyfin-server (10.6.0-1) unstable; urgency=medium + + * Forthcoming stable release + + -- Jellyfin Packaging Team Mon, 23 Mar 2020 14:46:05 -0400 + jellyfin (10.5.0-1) unstable; urgency=medium * New upstream version 10.5.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.5.0 diff --git a/debian/control b/debian/control index 13fd3ecabb..f473dc41d2 100644 --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: jellyfin +Source: jellyfin-server Section: misc Priority: optional Maintainer: Jellyfin Team @@ -8,15 +8,13 @@ Build-Depends: debhelper (>= 9), libcurl4-openssl-dev, libfontconfig1-dev, libfreetype6-dev, - libssl-dev, - wget, - npm | nodejs + libssl-dev Standards-Version: 3.9.4 Homepage: https://jellyfin.media/ Vcs-Git: https://github.org/jellyfin/jellyfin.git Vcs-Browser: https://github.org/jellyfin/jellyfin -Package: jellyfin +Package: jellyfin-server Replaces: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server Breaks: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server Conflicts: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server @@ -27,5 +25,6 @@ Depends: at, libfontconfig1, libfreetype6, libssl1.1 +Recommends: jellyfin-web Description: Jellyfin is a home media server. It is built on top of other popular open source technologies such as Service Stack, jQuery, jQuery mobile, and Mono. It features a REST-based api with built-in documentation to facilitate client development. We also have client libraries for our api to enable rapid development. diff --git a/debian/rules b/debian/rules index c2d57dfb22..2a5d41a696 100755 --- a/debian/rules +++ b/debian/rules @@ -2,8 +2,6 @@ CONFIG := Release TERM := xterm SHELL := /bin/bash -WEB_TARGET := $(CURDIR)/MediaBrowser.WebDashboard/jellyfin-web -WEB_VERSION := $(shell sed -n -e 's/^version: "\(.*\)"/\1/p' $(CURDIR)/build.yaml) HOST_ARCH := $(shell arch) BUILD_ARCH := ${DEB_HOST_MULTIARCH} @@ -41,25 +39,12 @@ override_dh_auto_test: override_dh_clistrip: override_dh_auto_build: - echo $(WEB_VERSION) - # Clone down and build Web frontend - mkdir -p $(WEB_TARGET) - wget -O web-src.tgz https://github.com/jellyfin/jellyfin-web/archive/v$(WEB_VERSION).tar.gz || wget -O web-src.tgz https://github.com/jellyfin/jellyfin-web/archive/master.tar.gz - mkdir -p $(CURDIR)/web - tar -xzf web-src.tgz -C $(CURDIR)/web/ --strip 1 - cd $(CURDIR)/web/ && npm install yarn - cd $(CURDIR)/web/ && node_modules/yarn/bin/yarn install - mv $(CURDIR)/web/dist/* $(WEB_TARGET)/ - # Build the application dotnet publish --configuration $(CONFIG) --output='$(CURDIR)/usr/lib/jellyfin/bin' --self-contained --runtime $(DOTNETRUNTIME) \ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" Jellyfin.Server override_dh_auto_clean: dotnet clean -maxcpucount:1 --configuration $(CONFIG) Jellyfin.Server || true - rm -f '$(CURDIR)/web-src.tgz' rm -rf '$(CURDIR)/usr' - rm -rf '$(CURDIR)/web' - rm -rf '$(WEB_TARGET)' # Force the service name to jellyfin even if we're building jellyfin-nightly override_dh_installinit: From c61e95d11757656f9a71ec4b6d410c4c5936f516 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 14:49:55 -0400 Subject: [PATCH 012/115] Only support Docker builds on amd64 --- build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.sh b/build.sh index b61126e11f..f318a0b1f6 100755 --- a/build.sh +++ b/build.sh @@ -39,6 +39,10 @@ do_build_native() { } do_build_docker() { + if ! dpkg --print-architecture | grep -q 'amd64'; then + echo "Docker-based builds only support amd64-based cross-building; use a native build instead" + exit 1 + fi if [[ ! -f deployment/Dockerfile.${PLATFORM} ]]; then echo "Missing Dockerfile for platform ${PLATFORM}" exit 1 From 163cf223aa1b0b89c159b4d23c9ee9d888b96416 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 15:00:41 -0400 Subject: [PATCH 013/115] Only support cross-building with Docker --- build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index f318a0b1f6..238871c168 100755 --- a/build.sh +++ b/build.sh @@ -34,13 +34,17 @@ list_platforms() { } do_build_native() { + if [[ $( dpkg --print-architecture | head -1 ) != "${PLATFORM##*.}" ]]; then + echo "Cross-building is not supported for native builds, use 'docker' builds on amd64 for cross-building." + exit 1 + fi export IS_DOCKER=NO deployment/build.${PLATFORM} } do_build_docker() { if ! dpkg --print-architecture | grep -q 'amd64'; then - echo "Docker-based builds only support amd64-based cross-building; use a native build instead" + echo "Docker-based builds only support amd64-based cross-building; use a 'native' build instead." exit 1 fi if [[ ! -f deployment/Dockerfile.${PLATFORM} ]]; then From 9c378866e4bcc26315c3618cd7d91c96f90630d5 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 15:02:54 -0400 Subject: [PATCH 014/115] Add arm64 and armhf builds --- deployment/Dockerfile.debian.arm64 | 42 ++++++++++++++++++++++++++++++ deployment/Dockerfile.debian.armhf | 42 ++++++++++++++++++++++++++++++ deployment/build.debian.arm64 | 27 +++++++++++++++++++ deployment/build.debian.armhf | 27 +++++++++++++++++++ 4 files changed, 138 insertions(+) create mode 100644 deployment/Dockerfile.debian.arm64 create mode 100644 deployment/Dockerfile.debian.armhf create mode 100755 deployment/build.debian.arm64 create mode 100755 deployment/build.debian.armhf diff --git a/deployment/Dockerfile.debian.arm64 b/deployment/Dockerfile.debian.arm64 new file mode 100644 index 0000000000..6e7e80d701 --- /dev/null +++ b/deployment/Dockerfile.debian.arm64 @@ -0,0 +1,42 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 +ENV IS_DOCKER=YES + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Prepare the cross-toolchain +RUN dpkg --add-architecture arm64 \ + && apt-get update \ + && apt-get install -y cross-gcc-dev \ + && TARGET_LIST="arm64" cross-gcc-gensource 8 \ + && cd cross-gcc-packages-amd64/cross-gcc-8-arm64 \ + && apt-get install -y gcc-8-source libstdc++-8-dev-arm64-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:arm64 linux-libc-dev:arm64 libgcc1:arm64 libcurl4-openssl-dev:arm64 libfontconfig1-dev:arm64 libfreetype6-dev:arm64 libssl-dev:arm64 liblttng-ust0:arm64 libstdc++-8-dev:arm64 + +# Link to build script +RUN ln -sf ${SOURCE_DIR}/deployment/build.debian.arm64 /build.sh + +# Create the source dir +RUN mkdir -p ${SOURCE_DIR} + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/build.sh"] diff --git a/deployment/Dockerfile.debian.armhf b/deployment/Dockerfile.debian.armhf new file mode 100644 index 0000000000..6e2e3a40cb --- /dev/null +++ b/deployment/Dockerfile.debian.armhf @@ -0,0 +1,42 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 +ENV IS_DOCKER=YES + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Prepare the cross-toolchain +RUN dpkg --add-architecture armhf \ + && apt-get update \ + && apt-get install -y cross-gcc-dev \ + && TARGET_LIST="armhf" cross-gcc-gensource 8 \ + && cd cross-gcc-packages-amd64/cross-gcc-8-armhf \ + && apt-get install -y gcc-8-source libstdc++-8-dev-armhf-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:armhf linux-libc-dev:armhf libgcc1:armhf libcurl4-openssl-dev:armhf libfontconfig1-dev:armhf libfreetype6-dev:armhf libssl-dev:armhf liblttng-ust0:armhf libstdc++-8-dev:armhf + +# Link to build script +RUN ln -sf ${SOURCE_DIR}/deployment/build.debian.armhf /build.sh + +# Create the source dir +RUN mkdir -p ${SOURCE_DIR} + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/build.sh"] diff --git a/deployment/build.debian.arm64 b/deployment/build.debian.arm64 new file mode 100755 index 0000000000..3525ae471c --- /dev/null +++ b/deployment/build.debian.arm64 @@ -0,0 +1,27 @@ +#!/bin/bash + +#= Debian 9+ arm64 .deb + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +if [[ ${IS_DOCKER} == YES ]]; then + # Remove build-dep for dotnet-sdk-3.1, since it's installed manually + sed -i '/dotnet-sdk-3.1,/d' debian/control +fi + +# Build DEB +export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} +dpkg-buildpackage -us -uc -a arm64 --pre-clean --post-clean + +mkdir -p ${ARTIFACT_DIR}/ +mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ + +if [[ ${IS_DOCKER} == YES ]]; then + chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} +fi + +popd diff --git a/deployment/build.debian.armhf b/deployment/build.debian.armhf new file mode 100755 index 0000000000..45730eebef --- /dev/null +++ b/deployment/build.debian.armhf @@ -0,0 +1,27 @@ +#!/bin/bash + +#= Debian 9+ arm64 .deb + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +if [[ ${IS_DOCKER} == YES ]]; then + # Remove build-dep for dotnet-sdk-3.1, since it's installed manually + sed -i '/dotnet-sdk-3.1,/d' debian/control +fi + +# Build DEB +export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} +dpkg-buildpackage -us -uc -a armhf --pre-clean --post-clean + +mkdir -p ${ARTIFACT_DIR}/ +mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ + +if [[ ${IS_DOCKER} == YES ]]; then + chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} +fi + +popd From 0365adb8233352c3261d669aeb83b8503100796b Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 15:24:13 -0400 Subject: [PATCH 015/115] Fix deps for armhf --- deployment/Dockerfile.debian.armhf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/Dockerfile.debian.armhf b/deployment/Dockerfile.debian.armhf index 6e2e3a40cb..8ebe1830ab 100644 --- a/deployment/Dockerfile.debian.armhf +++ b/deployment/Dockerfile.debian.armhf @@ -27,7 +27,7 @@ RUN dpkg --add-architecture armhf \ && apt-get install -y cross-gcc-dev \ && TARGET_LIST="armhf" cross-gcc-gensource 8 \ && cd cross-gcc-packages-amd64/cross-gcc-8-armhf \ - && apt-get install -y gcc-8-source libstdc++-8-dev-armhf-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:armhf linux-libc-dev:armhf libgcc1:armhf libcurl4-openssl-dev:armhf libfontconfig1-dev:armhf libfreetype6-dev:armhf libssl-dev:armhf liblttng-ust0:armhf libstdc++-8-dev:armhf + && apt-get install -y gcc-8-source libstdc++-8-dev-armhf-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip binutils-arm-linux-gnueabihf libc6-dev:armhf linux-libc-dev:armhf libgcc1:armhf libcurl4-openssl-dev:armhf libfontconfig1-dev:armhf libfreetype6-dev:armhf libssl-dev:armhf liblttng-ust0:armhf libstdc++-8-dev:armhf # Link to build script RUN ln -sf ${SOURCE_DIR}/deployment/build.debian.armhf /build.sh From c4a29e537cf7f74d592a4b230627876f0bf0de37 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 15:28:57 -0400 Subject: [PATCH 016/115] Remove NPM install from Dockerfiles --- deployment/Dockerfile.debian.amd64 | 2 +- deployment/Dockerfile.debian.arm64 | 2 +- deployment/Dockerfile.debian.armhf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deployment/Dockerfile.debian.amd64 b/deployment/Dockerfile.debian.amd64 index eb29402194..47c13fa712 100644 --- a/deployment/Dockerfile.debian.amd64 +++ b/deployment/Dockerfile.debian.amd64 @@ -12,7 +12,7 @@ ENV IS_DOCKER=YES # Prepare Debian build environment RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 # Install dotnet repository # https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current diff --git a/deployment/Dockerfile.debian.arm64 b/deployment/Dockerfile.debian.arm64 index 6e7e80d701..7b792d7e16 100644 --- a/deployment/Dockerfile.debian.arm64 +++ b/deployment/Dockerfile.debian.arm64 @@ -12,7 +12,7 @@ ENV IS_DOCKER=YES # Prepare Debian build environment RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv # Install dotnet repository # https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current diff --git a/deployment/Dockerfile.debian.armhf b/deployment/Dockerfile.debian.armhf index 8ebe1830ab..d633d316a2 100644 --- a/deployment/Dockerfile.debian.armhf +++ b/deployment/Dockerfile.debian.armhf @@ -12,7 +12,7 @@ ENV IS_DOCKER=YES # Prepare Debian build environment RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv # Install dotnet repository # https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current From f72c5b7a1d4db9b16f3b15cebe12bbca110bf7ef Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 15:40:19 -0400 Subject: [PATCH 017/115] Fix version output --- deployment/build.debian.amd64 | 2 +- deployment/build.debian.arm64 | 2 +- deployment/build.debian.armhf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deployment/build.debian.amd64 b/deployment/build.debian.amd64 index 89f8445d80..c43585161d 100755 --- a/deployment/build.debian.amd64 +++ b/deployment/build.debian.amd64 @@ -1,6 +1,6 @@ #!/bin/bash -#= Debian 9+ amd64 .deb +#= Debian 10+ amd64 .deb set -o errexit set -o xtrace diff --git a/deployment/build.debian.arm64 b/deployment/build.debian.arm64 index 3525ae471c..4225c2f9df 100755 --- a/deployment/build.debian.arm64 +++ b/deployment/build.debian.arm64 @@ -1,6 +1,6 @@ #!/bin/bash -#= Debian 9+ arm64 .deb +#= Debian 10+ arm64 .deb set -o errexit set -o xtrace diff --git a/deployment/build.debian.armhf b/deployment/build.debian.armhf index 45730eebef..f71a960410 100755 --- a/deployment/build.debian.armhf +++ b/deployment/build.debian.armhf @@ -1,6 +1,6 @@ #!/bin/bash -#= Debian 9+ arm64 .deb +#= Debian 10+ arm64 .deb set -o errexit set -o xtrace From 9ce2af2a6c20c061bb1317728262bad305d05f27 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 15:40:51 -0400 Subject: [PATCH 018/115] Don't limit to files (allow symlinks) --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 238871c168..f54ce04ce7 100755 --- a/build.sh +++ b/build.sh @@ -24,7 +24,7 @@ usage() { list_platforms() { declare -a platforms platforms=( - $( find deployment -maxdepth 1 -mindepth 1 -type f -name "build.*" | awk -F'.' '{ $1=""; print $2 "." $3 }' ) + $( find deployment -maxdepth 1 -mindepth 1 -name "build.*" | awk -F'.' '{ $1=""; print $2 "." $3 }' | sort ) ) echo -e "Valid platforms:" echo From 3e7a106a95a183ba4c7d1bf00d87e149463f0e23 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 15:40:59 -0400 Subject: [PATCH 019/115] Add Ubuntu configurations --- deployment/Dockerfile.ubuntu.amd64 | 34 +++++++++++++++++++ deployment/Dockerfile.ubuntu.arm64 | 53 ++++++++++++++++++++++++++++++ deployment/Dockerfile.ubuntu.armhf | 53 ++++++++++++++++++++++++++++++ deployment/build.ubuntu.amd64 | 26 +++++++++++++++ deployment/build.ubuntu.arm64 | 27 +++++++++++++++ deployment/build.ubuntu.armhf | 27 +++++++++++++++ 6 files changed, 220 insertions(+) create mode 100644 deployment/Dockerfile.ubuntu.amd64 create mode 100644 deployment/Dockerfile.ubuntu.arm64 create mode 100644 deployment/Dockerfile.ubuntu.armhf create mode 100755 deployment/build.ubuntu.amd64 create mode 100755 deployment/build.ubuntu.arm64 create mode 100755 deployment/build.ubuntu.armhf diff --git a/deployment/Dockerfile.ubuntu.amd64 b/deployment/Dockerfile.ubuntu.amd64 new file mode 100644 index 0000000000..e1b0c3975d --- /dev/null +++ b/deployment/Dockerfile.ubuntu.amd64 @@ -0,0 +1,34 @@ +FROM ubuntu:bionic +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 +ENV IS_DOCKER=YES + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Link to build script +RUN ln -sf ${SOURCE_DIR}/deployment/build.ubuntu.amd64 /build.sh + +# Create the source dir +RUN mkdir -p ${SOURCE_DIR} + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/build.sh"] diff --git a/deployment/Dockerfile.ubuntu.arm64 b/deployment/Dockerfile.ubuntu.arm64 new file mode 100644 index 0000000000..98dfbf7dd6 --- /dev/null +++ b/deployment/Dockerfile.ubuntu.arm64 @@ -0,0 +1,53 @@ +FROM ubuntu:bionic +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=arm64 +ENV IS_DOCKER=YES + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Prepare the cross-toolchain +RUN rm /etc/apt/sources.list \ + && export CODENAME="$( lsb_release -c -s )" \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/arm64.list \ + && echo "deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/arm64.list \ + && echo "deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/arm64.list \ + && echo "deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/arm64.list \ + && dpkg --add-architecture arm64 \ + && apt-get update \ + && apt-get install -y cross-gcc-dev \ + && TARGET_LIST="arm64" cross-gcc-gensource 6 \ + && cd cross-gcc-packages-amd64/cross-gcc-6-arm64 \ + && ln -fs /usr/share/zoneinfo/America/Toronto /etc/localtime \ + && apt-get install -y gcc-6-source libstdc++6-arm64-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libcloog-isl-dev libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:arm64 linux-libc-dev:arm64 libgcc1:arm64 libcurl4-openssl-dev:arm64 libfontconfig1-dev:arm64 libfreetype6-dev:arm64 liblttng-ust0:arm64 libstdc++6:arm64 libssl-dev:arm64 + +# Link to build script +RUN ln -sf ${SOURCE_DIR}/deployment/build.ubuntu.arm64 /build.sh + +# Create the source dir +RUN mkdir -p ${SOURCE_DIR} + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/build.sh"] diff --git a/deployment/Dockerfile.ubuntu.armhf b/deployment/Dockerfile.ubuntu.armhf new file mode 100644 index 0000000000..30cd861359 --- /dev/null +++ b/deployment/Dockerfile.ubuntu.armhf @@ -0,0 +1,53 @@ +FROM ubuntu:bionic +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=armhf +ENV IS_DOCKER=YES + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Prepare the cross-toolchain +RUN rm /etc/apt/sources.list \ + && export CODENAME="$( lsb_release -c -s )" \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/armhf.list \ + && echo "deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/armhf.list \ + && echo "deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/armhf.list \ + && echo "deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/armhf.list \ + && dpkg --add-architecture armhf \ + && apt-get update \ + && apt-get install -y cross-gcc-dev \ + && TARGET_LIST="armhf" cross-gcc-gensource 6 \ + && cd cross-gcc-packages-amd64/cross-gcc-6-armhf \ + && ln -fs /usr/share/zoneinfo/America/Toronto /etc/localtime \ + && apt-get install -y gcc-6-source libstdc++6-armhf-cross binutils-arm-linux-gnueabihf bison flex libtool gdb sharutils netbase libcloog-isl-dev libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:armhf linux-libc-dev:armhf libgcc1:armhf libcurl4-openssl-dev:armhf libfontconfig1-dev:armhf libfreetype6-dev:armhf liblttng-ust0:armhf libstdc++6:armhf libssl-dev:armhf + +# Link to build script +RUN ln -sf ${SOURCE_DIR}/deployment/build.debian.armhf /build.sh + +# Create the source dir +RUN mkdir -p ${SOURCE_DIR} + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/build.sh"] diff --git a/deployment/build.ubuntu.amd64 b/deployment/build.ubuntu.amd64 new file mode 100755 index 0000000000..e74db90c43 --- /dev/null +++ b/deployment/build.ubuntu.amd64 @@ -0,0 +1,26 @@ +#!/bin/bash + +#= Ubuntu 18.04+ amd64 .deb + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +if [[ ${IS_DOCKER} == YES ]]; then + # Remove build-dep for dotnet-sdk-3.1, since it's installed manually + sed -i '/dotnet-sdk-3.1,/d' debian/control +fi + +# Build DEB +dpkg-buildpackage -us -uc --pre-clean --post-clean + +mkdir -p ${ARTIFACT_DIR}/ +mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ + +if [[ ${IS_DOCKER} == YES ]]; then + chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} +fi + +popd diff --git a/deployment/build.ubuntu.arm64 b/deployment/build.ubuntu.arm64 new file mode 100755 index 0000000000..1d91b303ad --- /dev/null +++ b/deployment/build.ubuntu.arm64 @@ -0,0 +1,27 @@ +#!/bin/bash + +#= Ubuntu 18.04+ arm64 .deb + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +if [[ ${IS_DOCKER} == YES ]]; then + # Remove build-dep for dotnet-sdk-3.1, since it's installed manually + sed -i '/dotnet-sdk-3.1,/d' debian/control +fi + +# Build DEB +export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} +dpkg-buildpackage -us -uc -a arm64 --pre-clean --post-clean + +mkdir -p ${ARTIFACT_DIR}/ +mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ + +if [[ ${IS_DOCKER} == YES ]]; then + chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} +fi + +popd diff --git a/deployment/build.ubuntu.armhf b/deployment/build.ubuntu.armhf new file mode 100755 index 0000000000..efdc2b65b1 --- /dev/null +++ b/deployment/build.ubuntu.armhf @@ -0,0 +1,27 @@ +#!/bin/bash + +#= Ubuntu 18.04+ arm64 .deb + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +if [[ ${IS_DOCKER} == YES ]]; then + # Remove build-dep for dotnet-sdk-3.1, since it's installed manually + sed -i '/dotnet-sdk-3.1,/d' debian/control +fi + +# Build DEB +export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} +dpkg-buildpackage -us -uc -a armhf --pre-clean --post-clean + +mkdir -p ${ARTIFACT_DIR}/ +mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ + +if [[ ${IS_DOCKER} == YES ]]; then + chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} +fi + +popd From 8b1a76a32e5c2d8677fc6bba62682cfc1af748e6 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 15:44:23 -0400 Subject: [PATCH 020/115] Mount the source volume rather than copy it Now that the build script cleans up both before and after building, this is a viable option and will significant reduce build times by promoting container reuse (with `-k`). --- build.sh | 4 ++-- deployment/Dockerfile.debian.amd64 | 5 +---- deployment/Dockerfile.debian.arm64 | 5 +---- deployment/Dockerfile.debian.armhf | 5 +---- deployment/Dockerfile.ubuntu.amd64 | 5 +---- deployment/Dockerfile.ubuntu.arm64 | 5 +---- deployment/Dockerfile.ubuntu.armhf | 5 +---- 7 files changed, 8 insertions(+), 26 deletions(-) diff --git a/build.sh b/build.sh index f54ce04ce7..5d3f8ec713 100755 --- a/build.sh +++ b/build.sh @@ -16,7 +16,7 @@ usage() { echo -e " * docker: Build using the build script in a standardized Docker container" echo -e " * PLATFORM can be any platform shown by -l/--list-platforms and must be specified" echo -e " * If -k/--keep-artifacts is specified, transient artifacts (e.g. Docker containers) will be" - echo -e " retained after the build is finished" + echo -e " retained after the build is finished; the source directory will still be cleaned" echo -e " * If -l/--list-platforms is specified, all other arguments are ignored; the script will print" echo -e " the list of supported platforms and exit" } @@ -59,7 +59,7 @@ do_build_docker() { docker build . -t "jellyfin-builder.${PLATFORM}" -f deployment/Dockerfile.${PLATFORM} mkdir -p ${ARTIFACT_DIR} - docker run $docker_args -v "${ARTIFACT_DIR}:/dist" "jellyfin-builder.${PLATFORM}" + docker run $docker_args -v "${SOURCE_DIR}:/jellyfin" -v "${ARTIFACT_DIR}:/dist" "jellyfin-builder.${PLATFORM}" } while [[ $# -gt 0 ]]; do diff --git a/deployment/Dockerfile.debian.amd64 b/deployment/Dockerfile.debian.amd64 index 47c13fa712..b5a0380489 100644 --- a/deployment/Dockerfile.debian.amd64 +++ b/deployment/Dockerfile.debian.amd64 @@ -24,11 +24,8 @@ RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4 # Link to build script RUN ln -sf ${SOURCE_DIR}/deployment/build.debian.amd64 /build.sh -# Create the source dir -RUN mkdir -p ${SOURCE_DIR} +VOLUME ${SOURCE_DIR}/ VOLUME ${ARTIFACT_DIR}/ -COPY . ${SOURCE_DIR}/ - ENTRYPOINT ["/build.sh"] diff --git a/deployment/Dockerfile.debian.arm64 b/deployment/Dockerfile.debian.arm64 index 7b792d7e16..cfe562df33 100644 --- a/deployment/Dockerfile.debian.arm64 +++ b/deployment/Dockerfile.debian.arm64 @@ -32,11 +32,8 @@ RUN dpkg --add-architecture arm64 \ # Link to build script RUN ln -sf ${SOURCE_DIR}/deployment/build.debian.arm64 /build.sh -# Create the source dir -RUN mkdir -p ${SOURCE_DIR} +VOLUME ${SOURCE_DIR}/ VOLUME ${ARTIFACT_DIR}/ -COPY . ${SOURCE_DIR}/ - ENTRYPOINT ["/build.sh"] diff --git a/deployment/Dockerfile.debian.armhf b/deployment/Dockerfile.debian.armhf index d633d316a2..ea8c8c8e62 100644 --- a/deployment/Dockerfile.debian.armhf +++ b/deployment/Dockerfile.debian.armhf @@ -32,11 +32,8 @@ RUN dpkg --add-architecture armhf \ # Link to build script RUN ln -sf ${SOURCE_DIR}/deployment/build.debian.armhf /build.sh -# Create the source dir -RUN mkdir -p ${SOURCE_DIR} +VOLUME ${SOURCE_DIR}/ VOLUME ${ARTIFACT_DIR}/ -COPY . ${SOURCE_DIR}/ - ENTRYPOINT ["/build.sh"] diff --git a/deployment/Dockerfile.ubuntu.amd64 b/deployment/Dockerfile.ubuntu.amd64 index e1b0c3975d..e61be4efcc 100644 --- a/deployment/Dockerfile.ubuntu.amd64 +++ b/deployment/Dockerfile.ubuntu.amd64 @@ -24,11 +24,8 @@ RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4 # Link to build script RUN ln -sf ${SOURCE_DIR}/deployment/build.ubuntu.amd64 /build.sh -# Create the source dir -RUN mkdir -p ${SOURCE_DIR} +VOLUME ${SOURCE_DIR}/ VOLUME ${ARTIFACT_DIR}/ -COPY . ${SOURCE_DIR}/ - ENTRYPOINT ["/build.sh"] diff --git a/deployment/Dockerfile.ubuntu.arm64 b/deployment/Dockerfile.ubuntu.arm64 index 98dfbf7dd6..e34ef7edd1 100644 --- a/deployment/Dockerfile.ubuntu.arm64 +++ b/deployment/Dockerfile.ubuntu.arm64 @@ -43,11 +43,8 @@ RUN rm /etc/apt/sources.list \ # Link to build script RUN ln -sf ${SOURCE_DIR}/deployment/build.ubuntu.arm64 /build.sh -# Create the source dir -RUN mkdir -p ${SOURCE_DIR} +VOLUME ${SOURCE_DIR}/ VOLUME ${ARTIFACT_DIR}/ -COPY . ${SOURCE_DIR}/ - ENTRYPOINT ["/build.sh"] diff --git a/deployment/Dockerfile.ubuntu.armhf b/deployment/Dockerfile.ubuntu.armhf index 30cd861359..6f92c81ab1 100644 --- a/deployment/Dockerfile.ubuntu.armhf +++ b/deployment/Dockerfile.ubuntu.armhf @@ -43,11 +43,8 @@ RUN rm /etc/apt/sources.list \ # Link to build script RUN ln -sf ${SOURCE_DIR}/deployment/build.debian.armhf /build.sh -# Create the source dir -RUN mkdir -p ${SOURCE_DIR} +VOLUME ${SOURCE_DIR}/ VOLUME ${ARTIFACT_DIR}/ -COPY . ${SOURCE_DIR}/ - ENTRYPOINT ["/build.sh"] From eb632e4a0dd5d83a1aea4c710caf1ea0f3ad6b0e Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 16:01:25 -0400 Subject: [PATCH 021/115] Back up and restore control file --- deployment/build.debian.amd64 | 2 ++ deployment/build.debian.arm64 | 2 ++ deployment/build.debian.armhf | 2 ++ deployment/build.ubuntu.amd64 | 2 ++ deployment/build.ubuntu.arm64 | 2 ++ deployment/build.ubuntu.armhf | 2 ++ 6 files changed, 12 insertions(+) diff --git a/deployment/build.debian.amd64 b/deployment/build.debian.amd64 index c43585161d..0eb9ee5c83 100755 --- a/deployment/build.debian.amd64 +++ b/deployment/build.debian.amd64 @@ -10,6 +10,7 @@ pushd ${SOURCE_DIR} if [[ ${IS_DOCKER} == YES ]]; then # Remove build-dep for dotnet-sdk-3.1, since it's installed manually + cp debian/control debian/control.orig sed -i '/dotnet-sdk-3.1,/d' debian/control fi @@ -20,6 +21,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then + mv debian/control.orig debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi diff --git a/deployment/build.debian.arm64 b/deployment/build.debian.arm64 index 4225c2f9df..d1ce85e2fa 100755 --- a/deployment/build.debian.arm64 +++ b/deployment/build.debian.arm64 @@ -10,6 +10,7 @@ pushd ${SOURCE_DIR} if [[ ${IS_DOCKER} == YES ]]; then # Remove build-dep for dotnet-sdk-3.1, since it's installed manually + cp debian/control debian/control.orig sed -i '/dotnet-sdk-3.1,/d' debian/control fi @@ -21,6 +22,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then + mv debian/control.orig debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi diff --git a/deployment/build.debian.armhf b/deployment/build.debian.armhf index f71a960410..3941583544 100755 --- a/deployment/build.debian.armhf +++ b/deployment/build.debian.armhf @@ -10,6 +10,7 @@ pushd ${SOURCE_DIR} if [[ ${IS_DOCKER} == YES ]]; then # Remove build-dep for dotnet-sdk-3.1, since it's installed manually + cp debian/control debian/control.orig sed -i '/dotnet-sdk-3.1,/d' debian/control fi @@ -21,6 +22,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then + mv debian/control.orig debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi diff --git a/deployment/build.ubuntu.amd64 b/deployment/build.ubuntu.amd64 index e74db90c43..86653cb384 100755 --- a/deployment/build.ubuntu.amd64 +++ b/deployment/build.ubuntu.amd64 @@ -10,6 +10,7 @@ pushd ${SOURCE_DIR} if [[ ${IS_DOCKER} == YES ]]; then # Remove build-dep for dotnet-sdk-3.1, since it's installed manually + cp debian/control debian/control.orig sed -i '/dotnet-sdk-3.1,/d' debian/control fi @@ -20,6 +21,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then + mv debian/control.orig debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi diff --git a/deployment/build.ubuntu.arm64 b/deployment/build.ubuntu.arm64 index 1d91b303ad..f065170092 100755 --- a/deployment/build.ubuntu.arm64 +++ b/deployment/build.ubuntu.arm64 @@ -10,6 +10,7 @@ pushd ${SOURCE_DIR} if [[ ${IS_DOCKER} == YES ]]; then # Remove build-dep for dotnet-sdk-3.1, since it's installed manually + cp debian/control debian/control.orig sed -i '/dotnet-sdk-3.1,/d' debian/control fi @@ -21,6 +22,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then + mv debian/control.orig debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi diff --git a/deployment/build.ubuntu.armhf b/deployment/build.ubuntu.armhf index efdc2b65b1..679fde5ae1 100755 --- a/deployment/build.ubuntu.armhf +++ b/deployment/build.ubuntu.armhf @@ -10,6 +10,7 @@ pushd ${SOURCE_DIR} if [[ ${IS_DOCKER} == YES ]]; then # Remove build-dep for dotnet-sdk-3.1, since it's installed manually + cp debian/control debian/control.orig sed -i '/dotnet-sdk-3.1,/d' debian/control fi @@ -21,6 +22,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then + mv debian/control.orig debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi From 6028bc0f7915a09caea881462008561424a15829 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 16:28:49 -0400 Subject: [PATCH 022/115] Port Fedora and CentOS builds and remove web build Simplifies a number of aspects of the RPM build, including moving .copr/Makefile into the "fedora/" folder (and leaving a symlink), removing the jellyfin-web build components, and renaming it jellyfin-server like Debian did. --- .copr/Makefile | 60 +---------- deployment/Dockerfile.centos.amd64 | 32 ++++++ deployment/Dockerfile.fedora.amd64 | 33 ++++++ deployment/build.centos.amd64 | 24 +++++ deployment/build.fedora.amd64 | 24 +++++ fedora/.gitignore | 3 + fedora/Makefile | 29 ++++++ fedora/README.md | 43 ++++++++ fedora/jellyfin-firewalld.xml | 9 ++ fedora/jellyfin.env | 34 +++++++ fedora/jellyfin.override.conf | 7 ++ fedora/jellyfin.service | 15 +++ fedora/jellyfin.spec | 158 +++++++++++++++++++++++++++++ fedora/jellyfin.sudoers | 19 ++++ fedora/restart.sh | 36 +++++++ 15 files changed, 467 insertions(+), 59 deletions(-) mode change 100644 => 120000 .copr/Makefile create mode 100644 deployment/Dockerfile.centos.amd64 create mode 100644 deployment/Dockerfile.fedora.amd64 create mode 100755 deployment/build.centos.amd64 create mode 100755 deployment/build.fedora.amd64 create mode 100644 fedora/.gitignore create mode 100644 fedora/Makefile create mode 100644 fedora/README.md create mode 100644 fedora/jellyfin-firewalld.xml create mode 100644 fedora/jellyfin.env create mode 100644 fedora/jellyfin.override.conf create mode 100644 fedora/jellyfin.service create mode 100644 fedora/jellyfin.spec create mode 100644 fedora/jellyfin.sudoers create mode 100755 fedora/restart.sh diff --git a/.copr/Makefile b/.copr/Makefile deleted file mode 100644 index ba330ada95..0000000000 --- a/.copr/Makefile +++ /dev/null @@ -1,59 +0,0 @@ -VERSION := $(shell sed -ne '/^Version:/s/.* *//p' \ - deployment/fedora-package-x64/pkg-src/jellyfin.spec) - -deployment/fedora-package-x64/pkg-src/jellyfin-web-$(VERSION).tar.gz: - curl -f -L -o deployment/fedora-package-x64/pkg-src/jellyfin-web-$(VERSION).tar.gz \ - https://github.com/jellyfin/jellyfin-web/archive/v$(VERSION).tar.gz \ - || curl -f -L -o deployment/fedora-package-x64/pkg-src/jellyfin-web-$(VERSION).tar.gz \ - https://github.com/jellyfin/jellyfin-web/archive/master.tar.gz \ - -srpm: deployment/fedora-package-x64/pkg-src/jellyfin-web-$(VERSION).tar.gz - cd deployment/fedora-package-x64; \ - SOURCE_DIR=../.. \ - WORKDIR="$${PWD}"; \ - package_temporary_dir="$${WORKDIR}/pkg-dist-tmp"; \ - pkg_src_dir="$${WORKDIR}/pkg-src"; \ - GNU_TAR=1; \ - tar \ - --transform "s,^\.,jellyfin-$(VERSION)," \ - --exclude='.git*' \ - --exclude='**/.git' \ - --exclude='**/.hg' \ - --exclude='**/.vs' \ - --exclude='**/.vscode' \ - --exclude='deployment' \ - --exclude='**/bin' \ - --exclude='**/obj' \ - --exclude='**/.nuget' \ - --exclude='*.deb' \ - --exclude='*.rpm' \ - -czf "pkg-src/jellyfin-$(VERSION).tar.gz" \ - -C $${SOURCE_DIR} ./ || GNU_TAR=0; \ - if [ $${GNU_TAR} -eq 0 ]; then \ - package_temporary_dir="$$(mktemp -d)"; \ - mkdir -p "$${package_temporary_dir}/jellyfin"; \ - tar \ - --exclude='.git*' \ - --exclude='**/.git' \ - --exclude='**/.hg' \ - --exclude='**/.vs' \ - --exclude='**/.vscode' \ - --exclude='deployment' \ - --exclude='**/bin' \ - --exclude='**/obj' \ - --exclude='**/.nuget' \ - --exclude='*.deb' \ - --exclude='*.rpm' \ - -czf "$${package_temporary_dir}/jellyfin/jellyfin-$(VERSION).tar.gz" \ - -C $${SOURCE_DIR} ./; \ - mkdir -p "$${package_temporary_dir}/jellyfin-$(VERSION)"; \ - tar -xzf "$${package_temporary_dir}/jellyfin/jellyfin-$(VERSION).tar.gz" \ - -C "$${package_temporary_dir}/jellyfin-$(VERSION); \ - rm -f "$${package_temporary_dir}/jellyfin/jellyfin-$(VERSION).tar.gz"; \ - tar -czf "$${SOURCE_DIR}/SOURCES/pkg-src/jellyfin-$(VERSION).tar.gz" \ - -C "$${package_temporary_dir}" "jellyfin-$(VERSION); \ - rm -rf $${package_temporary_dir}; \ - fi; \ - rpmbuild -bs pkg-src/jellyfin.spec \ - --define "_sourcedir $$PWD/pkg-src/" \ - --define "_srcrpmdir $(outdir)" diff --git a/.copr/Makefile b/.copr/Makefile new file mode 120000 index 0000000000..ec3c90dfd9 --- /dev/null +++ b/.copr/Makefile @@ -0,0 +1 @@ +../fedora/Makefile \ No newline at end of file diff --git a/deployment/Dockerfile.centos.amd64 b/deployment/Dockerfile.centos.amd64 new file mode 100644 index 0000000000..39788cc0ee --- /dev/null +++ b/deployment/Dockerfile.centos.amd64 @@ -0,0 +1,32 @@ +FROM centos:7 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV IS_DOCKER=YES + +# Prepare CentOS environment +RUN yum update -y \ + && yum install -y epel-release \ + && yum install -y @buildsys-build rpmdevtools yum-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel git + +# Install DotNET SDK +RUN rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm \ + && rpmdev-setuptree \ + && yum install -y dotnet-sdk-${SDK_VERSION} + +# Create symlinks and directories +RUN ln -sf ${SOURCE_DIR}/deployment/build.centos.amd64 /build.sh \ + && mkdir -p ${SOURCE_DIR}/SPECS \ + && ln -s ${SOURCE_DIR}/fedora/jellyfin.spec ${SOURCE_DIR}/SPECS/jellyfin.spec \ + && mkdir -p ${SOURCE_DIR}/SOURCES \ + && ln -s ${SOURCE_DIR}/fedora ${SOURCE_DIR}/SOURCES + +VOLUME ${SOURCE_DIR}/ + +VOLUME ${ARTIFACT_DIR}/ + +ENTRYPOINT ["/build.sh"] diff --git a/deployment/Dockerfile.fedora.amd64 b/deployment/Dockerfile.fedora.amd64 new file mode 100644 index 0000000000..73148763de --- /dev/null +++ b/deployment/Dockerfile.fedora.amd64 @@ -0,0 +1,33 @@ +FROM fedora:31 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV IS_DOCKER=YES + +# Prepare Fedora environment +RUN dnf update -y + +# Install build dependencies +RUN dnf install -y @buildsys-build rpmdevtools git dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel + +# Install DotNET SDK +RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \ + && curl -o /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/$(rpm -E %fedora)/prod.repo \ + && dnf install -y dotnet-sdk-${SDK_VERSION} dotnet-runtime-${SDK_VERSION} + +# Create symlinks and directories +RUN ln -sf ${SOURCE_DIR}/deployment/build.fedora.amd64 /build.sh \ + && mkdir -p ${SOURCE_DIR}/SPECS \ + && ln -s ${SOURCE_DIR}/fedora/jellyfin.spec ${SOURCE_DIR}/SPECS/jellyfin.spec \ + && mkdir -p ${SOURCE_DIR}/SOURCES \ + && ln -s ${SOURCE_DIR}/fedora ${SOURCE_DIR}/SOURCES + +VOLUME ${SOURCE_DIR}/ + +VOLUME ${ARTIFACT_DIR}/ + +ENTRYPOINT ["/build.sh"] diff --git a/deployment/build.centos.amd64 b/deployment/build.centos.amd64 new file mode 100755 index 0000000000..939bbc45a4 --- /dev/null +++ b/deployment/build.centos.amd64 @@ -0,0 +1,24 @@ +#!/bin/bash + +#= CentOS/RHEL 7+ amd64 .rpm + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Build RPM +make -f fedora/Makefile srpm outdir=/root/rpmbuild/SRPMS +rpmbuild --rebuild -bb /root/rpmbuild/SRPMS/jellyfin-*.src.rpm + +# Move the artifacts out +mv /root/rpmbuild/RPMS/x86_64/jellyfin-*.rpm /root/rpmbuild/SRPMS/jellyfin-*.src.rpm ${ARTIFACT_DIR}/ + +if [[ ${IS_DOCKER} == YES ]]; then + chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} +fi + +rm -f fedora/jellyfin*.tar.gz + +popd diff --git a/deployment/build.fedora.amd64 b/deployment/build.fedora.amd64 new file mode 100755 index 0000000000..8ac99decc1 --- /dev/null +++ b/deployment/build.fedora.amd64 @@ -0,0 +1,24 @@ +#!/bin/bash + +#= Fedora 29+ amd64 .rpm + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Build RPM +make -f fedora/Makefile srpm outdir=/root/rpmbuild/SRPMS +rpmbuild -rb /root/rpmbuild/SRPMS/jellyfin-*.src.rpm + +# Move the artifacts out +mv /root/rpmbuild/RPMS/x86_64/jellyfin-*.rpm /root/rpmbuild/SRPMS/jellyfin-*.src.rpm ${ARTIFACT_DIR}/ + +if [[ ${IS_DOCKER} == YES ]]; then + chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} +fi + +rm -f fedora/jellyfin*.tar.gz + +popd diff --git a/fedora/.gitignore b/fedora/.gitignore new file mode 100644 index 0000000000..6019b98c22 --- /dev/null +++ b/fedora/.gitignore @@ -0,0 +1,3 @@ +*.rpm +*.zip +*.tar.gz \ No newline at end of file diff --git a/fedora/Makefile b/fedora/Makefile new file mode 100644 index 0000000000..1d2709a2fe --- /dev/null +++ b/fedora/Makefile @@ -0,0 +1,29 @@ +VERSION := $(shell sed -ne '/^Version:/s/.* *//p' fedora/jellyfin.spec) + +srpm: + cd fedora/; \ + SOURCE_DIR=.. \ + WORKDIR="$${PWD}"; \ + package_temporary_dir="$${WORKDIR}/pkg-dist-tmp"; \ + pkg_src_dir="$${WORKDIR}"; \ + GNU_TAR=1; \ + tar \ + --transform "s,^\.,jellyfin-server-$(VERSION)," \ + --exclude='.git*' \ + --exclude='**/.git' \ + --exclude='**/.hg' \ + --exclude='**/.vs' \ + --exclude='**/.vscode' \ + --exclude='deployment' \ + --exclude='**/bin' \ + --exclude='**/obj' \ + --exclude='**/.nuget' \ + --exclude='*.deb' \ + --exclude='*.rpm' \ + --exclude='jellyfin-server-$(VERSION).tar.gz' \ + -czf "jellyfin-server-$(VERSION).tar.gz" \ + -C $${SOURCE_DIR} ./ + cd fedora/; \ + rpmbuild -bs jellyfin.spec \ + --define "_sourcedir $$PWD/" \ + --define "_srcrpmdir $(outdir)" diff --git a/fedora/README.md b/fedora/README.md new file mode 100644 index 0000000000..7ed6f7efc6 --- /dev/null +++ b/fedora/README.md @@ -0,0 +1,43 @@ +# Jellyfin RPM + +## Build Fedora Package with docker + +Change into this directory `cd rpm-package` +Run the build script `./build-fedora-rpm.sh`. +Resulting RPM and src.rpm will be in `../../jellyfin-*.rpm` + +## ffmpeg + +The RPM package for Fedora/CentOS requires some additional repositories as ffmpeg is not in the main repositories. + +```shell +# ffmpeg from RPMfusion free +# Fedora +$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm +# CentOS 7 +$ sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm +``` + +## ISO mounting + +To allow Jellyfin to mount/umount ISO files uncomment these two lines in `/etc/sudoers.d/jellyfin-sudoers` +``` +# %jellyfin ALL=(ALL) NOPASSWD: /bin/mount +# %jellyfin ALL=(ALL) NOPASSWD: /bin/umount +``` + +## Building with dotnet + +Jellyfin is build with `--self-contained` so no dotnet required for runtime. + +```shell +# dotnet required for building the RPM +# Fedora +$ sudo dnf copr enable @dotnet-sig/dotnet +# CentOS +$ sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm +``` + +## TODO + +- [ ] OpenSUSE \ No newline at end of file diff --git a/fedora/jellyfin-firewalld.xml b/fedora/jellyfin-firewalld.xml new file mode 100644 index 0000000000..538c5d65f8 --- /dev/null +++ b/fedora/jellyfin-firewalld.xml @@ -0,0 +1,9 @@ + + + Jellyfin + The Free Software Media System. + + + + + diff --git a/fedora/jellyfin.env b/fedora/jellyfin.env new file mode 100644 index 0000000000..de48f13af5 --- /dev/null +++ b/fedora/jellyfin.env @@ -0,0 +1,34 @@ +# Jellyfin default configuration options + +# Use this file to override the default configurations; add additional +# options with JELLYFIN_ADD_OPTS. + +# To override the user or this config file's location, use +# /etc/systemd/system/jellyfin.service.d/override.conf + +# +# This is a POSIX shell fragment +# + +# +# General options +# + +# Program directories +JELLYFIN_DATA_DIR="/var/lib/jellyfin" +JELLYFIN_CONFIG_DIR="/etc/jellyfin" +JELLYFIN_LOG_DIR="/var/log/jellyfin" +JELLYFIN_CACHE_DIR="/var/cache/jellyfin" + +# In-App service control +JELLYFIN_RESTART_OPT="--restartpath=/usr/libexec/jellyfin/restart.sh" + +# [OPTIONAL] ffmpeg binary paths, overriding the UI-configured values +#JELLYFIN_FFMPEG_OPT="--ffmpeg=/usr/bin/ffmpeg" + +# [OPTIONAL] run Jellyfin as a headless service +#JELLYFIN_SERVICE_OPT="--service" + +# [OPTIONAL] run Jellyfin without the web app +#JELLYFIN_NOWEBAPP_OPT="--noautorunwebapp" + diff --git a/fedora/jellyfin.override.conf b/fedora/jellyfin.override.conf new file mode 100644 index 0000000000..8652450bb4 --- /dev/null +++ b/fedora/jellyfin.override.conf @@ -0,0 +1,7 @@ +# Jellyfin systemd configuration options + +# Use this file to override the user or environment file location. + +[Service] +#User = jellyfin +#EnvironmentFile = /etc/sysconfig/jellyfin diff --git a/fedora/jellyfin.service b/fedora/jellyfin.service new file mode 100644 index 0000000000..f3dc594b1c --- /dev/null +++ b/fedora/jellyfin.service @@ -0,0 +1,15 @@ +[Unit] +After=network.target +Description=Jellyfin is a free software media system that puts you in control of managing and streaming your media. + +[Service] +EnvironmentFile=/etc/sysconfig/jellyfin +WorkingDirectory=/var/lib/jellyfin +ExecStart=/usr/bin/jellyfin ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT} +TimeoutSec=15 +Restart=on-failure +User=jellyfin +Group=jellyfin + +[Install] +WantedBy=multi-user.target diff --git a/fedora/jellyfin.spec b/fedora/jellyfin.spec new file mode 100644 index 0000000000..e6a3170b56 --- /dev/null +++ b/fedora/jellyfin.spec @@ -0,0 +1,158 @@ +%global debug_package %{nil} +# Set the dotnet runtime +%if 0%{?fedora} +%global dotnet_runtime fedora-x64 +%else +%global dotnet_runtime centos-x64 +%endif + +Name: jellyfin-server +Version: 10.6.0 +Release: 1%{?dist} +Summary: The Free Software Media Browser +License: GPLv2 +URL: https://jellyfin.media +# Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%{version}.tar.gz` +Source0: jellyfin-server-%{version}.tar.gz +Source11: jellyfin.service +Source12: jellyfin.env +Source13: jellyfin.sudoers +Source14: restart.sh +Source15: jellyfin.override.conf +Source16: jellyfin-firewalld.xml + +%{?systemd_requires} +BuildRequires: systemd +Requires(pre): shadow-utils +BuildRequires: libcurl-devel, fontconfig-devel, freetype-devel, openssl-devel, glibc-devel, libicu-devel +Requires: libcurl, fontconfig, freetype, openssl, glibc libicu +# Requirements not packaged in main repos +# COPR @dotnet-sig/dotnet or +# https://packages.microsoft.com/rhel/7/prod/ +BuildRequires: dotnet-runtime-3.1, dotnet-sdk-3.1 +# RPMfusion free +Requires: ffmpeg + +# Disable Automatic Dependency Processing +AutoReqProv: no + +%description +Jellyfin is a free software media system that puts you in control of managing and streaming your media. + + +%prep +%autosetup -n jellyfin-server-%{version} -b 0 + +%build + +%install +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime %{dotnet_runtime} \ + "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" Jellyfin.Server +%{__install} -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/jellyfin/LICENSE +%{__install} -D -m 0644 %{SOURCE15} %{buildroot}%{_sysconfdir}/systemd/system/jellyfin.service.d/override.conf +%{__install} -D -m 0644 Jellyfin.Server/Resources/Configuration/logging.json %{buildroot}%{_sysconfdir}/jellyfin/logging.json +%{__mkdir} -p %{buildroot}%{_bindir} +tee %{buildroot}%{_bindir}/jellyfin << EOF +#!/bin/sh +exec %{_libdir}/jellyfin/jellyfin \${@} +EOF +%{__mkdir} -p %{buildroot}%{_sharedstatedir}/jellyfin +%{__mkdir} -p %{buildroot}%{_sysconfdir}/jellyfin +%{__mkdir} -p %{buildroot}%{_var}/log/jellyfin +%{__mkdir} -p %{buildroot}%{_var}/cache/jellyfin + +%{__install} -D -m 0644 %{SOURCE11} %{buildroot}%{_unitdir}/jellyfin.service +%{__install} -D -m 0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/sysconfig/jellyfin +%{__install} -D -m 0600 %{SOURCE13} %{buildroot}%{_sysconfdir}/sudoers.d/jellyfin-sudoers +%{__install} -D -m 0755 %{SOURCE14} %{buildroot}%{_libexecdir}/jellyfin/restart.sh +%{__install} -D -m 0644 %{SOURCE16} %{buildroot}%{_prefix}/lib/firewalld/services/jellyfin.xml + +%files +%attr(755,root,root) %{_bindir}/jellyfin +%{_libdir}/jellyfin/*.json +%{_libdir}/jellyfin/*.dll +%{_libdir}/jellyfin/*.so +%{_libdir}/jellyfin/*.a +%{_libdir}/jellyfin/createdump +# Needs 755 else only root can run it since binary build by dotnet is 722 +%attr(755,root,root) %{_libdir}/jellyfin/jellyfin +%{_libdir}/jellyfin/SOS_README.md +%{_unitdir}/jellyfin.service +%{_libexecdir}/jellyfin/restart.sh +%{_prefix}/lib/firewalld/services/jellyfin.xml +%attr(755,jellyfin,jellyfin) %dir %{_sysconfdir}/jellyfin +%config %{_sysconfdir}/sysconfig/jellyfin +%config(noreplace) %attr(600,root,root) %{_sysconfdir}/sudoers.d/jellyfin-sudoers +%config(noreplace) %{_sysconfdir}/systemd/system/jellyfin.service.d/override.conf +%config(noreplace) %attr(644,jellyfin,jellyfin) %{_sysconfdir}/jellyfin/logging.json +%attr(750,jellyfin,jellyfin) %dir %{_sharedstatedir}/jellyfin +%attr(-,jellyfin,jellyfin) %dir %{_var}/log/jellyfin +%attr(750,jellyfin,jellyfin) %dir %{_var}/cache/jellyfin +%{_datadir}/licenses/jellyfin/LICENSE + +%pre +getent group jellyfin >/dev/null || groupadd -r jellyfin +getent passwd jellyfin >/dev/null || \ + useradd -r -g jellyfin -d %{_sharedstatedir}/jellyfin -s /sbin/nologin \ + -c "Jellyfin default user" jellyfin +exit 0 + +%post +# Move existing configuration cache and logs to their new locations and symlink them. +if [ $1 -gt 1 ] ; then + service_state=$(systemctl is-active jellyfin.service) + if [ "${service_state}" = "active" ]; then + systemctl stop jellyfin.service + fi + if [ ! -L %{_sharedstatedir}/jellyfin/config ]; then + mv %{_sharedstatedir}/jellyfin/config/* %{_sysconfdir}/jellyfin/ + rmdir %{_sharedstatedir}/jellyfin/config + ln -sf %{_sysconfdir}/jellyfin %{_sharedstatedir}/jellyfin/config + fi + if [ ! -L %{_sharedstatedir}/jellyfin/logs ]; then + mv %{_sharedstatedir}/jellyfin/logs/* %{_var}/log/jellyfin + rmdir %{_sharedstatedir}/jellyfin/logs + ln -sf %{_var}/log/jellyfin %{_sharedstatedir}/jellyfin/logs + fi + if [ ! -L %{_sharedstatedir}/jellyfin/cache ]; then + mv %{_sharedstatedir}/jellyfin/cache/* %{_var}/cache/jellyfin + rmdir %{_sharedstatedir}/jellyfin/cache + ln -sf %{_var}/cache/jellyfin %{_sharedstatedir}/jellyfin/cache + fi + if [ "${service_state}" = "active" ]; then + systemctl start jellyfin.service + fi +fi +%systemd_post jellyfin.service + +%preun +%systemd_preun jellyfin.service + +%postun +%systemd_postun_with_restart jellyfin.service + +%changelog +* Mon Mar 23 2020 Jellyfin Packaging Team +- Forthcoming stable release +* Fri Oct 11 2019 Jellyfin Packaging Team +- New upstream version 10.5.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.5.0 +* Sat Aug 31 2019 Jellyfin Packaging Team +- New upstream version 10.4.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.4.0 +* Wed Jul 24 2019 Jellyfin Packaging Team +- New upstream version 10.3.7; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.7 +* Sat Jul 06 2019 Jellyfin Packaging Team +- New upstream version 10.3.6; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.6 +* Sun Jun 09 2019 Jellyfin Packaging Team +- New upstream version 10.3.5; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.5 +* Thu Jun 06 2019 Jellyfin Packaging Team +- New upstream version 10.3.4; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.4 +* Fri May 17 2019 Jellyfin Packaging Team +- New upstream version 10.3.3; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.3 +* Tue Apr 30 2019 Jellyfin Packaging Team +- New upstream version 10.3.2; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.2 +* Sat Apr 20 2019 Jellyfin Packaging Team +- New upstream version 10.3.1; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.1 +* Fri Apr 19 2019 Jellyfin Packaging Team +- New upstream version 10.3.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.0 diff --git a/fedora/jellyfin.sudoers b/fedora/jellyfin.sudoers new file mode 100644 index 0000000000..dd245af4b8 --- /dev/null +++ b/fedora/jellyfin.sudoers @@ -0,0 +1,19 @@ +# Allow jellyfin group to start, stop and restart itself +Cmnd_Alias RESTARTSERVER_SYSTEMD = /usr/bin/systemctl restart jellyfin, /bin/systemctl restart jellyfin +Cmnd_Alias STARTSERVER_SYSTEMD = /usr/bin/systemctl start jellyfin, /bin/systemctl start jellyfin +Cmnd_Alias STOPSERVER_SYSTEMD = /usr/bin/systemctl stop jellyfin, /bin/systemctl stop jellyfin + + +jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSTEMD +jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSTEMD +jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSTEMD + +Defaults!RESTARTSERVER_SYSTEMD !requiretty +Defaults!STARTSERVER_SYSTEMD !requiretty +Defaults!STOPSERVER_SYSTEMD !requiretty + +# Allow the server to mount iso images +jellyfin ALL=(ALL) NOPASSWD: /bin/mount +jellyfin ALL=(ALL) NOPASSWD: /bin/umount + +Defaults:jellyfin !requiretty diff --git a/fedora/restart.sh b/fedora/restart.sh new file mode 100755 index 0000000000..9e53efecd0 --- /dev/null +++ b/fedora/restart.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# restart.sh - Jellyfin server restart script +# Part of the Jellyfin project (https://github.com/jellyfin) +# +# This script restarts the Jellyfin daemon on Linux when using +# the Restart button on the admin dashboard. It supports the +# systemctl, service, and traditional /etc/init.d (sysv) restart +# methods, chosen automatically by which one is found first (in +# that order). +# +# This script is used by the Debian/Ubuntu/Fedora/CentOS packages. + +get_service_command() { + for command in systemctl service; do + if which $command &>/dev/null; then + echo $command && return + fi + done + echo "sysv" +} + +cmd="$( get_service_command )" +echo "Detected service control platform '$cmd'; using it to restart Jellyfin..." +case $cmd in + 'systemctl') + echo "sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin" | at now + ;; + 'service') + echo "sleep 2; /usr/bin/sudo $( which service ) jellyfin restart" | at now + ;; + 'sysv') + echo "sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart" | at now + ;; +esac +exit 0 From cf6dc609b72fd9b388c987ae38c0a8bf95168d15 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 17:54:17 -0400 Subject: [PATCH 023/115] Fix up single-segment platform names --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 5d3f8ec713..8256f9ea31 100755 --- a/build.sh +++ b/build.sh @@ -24,7 +24,7 @@ usage() { list_platforms() { declare -a platforms platforms=( - $( find deployment -maxdepth 1 -mindepth 1 -name "build.*" | awk -F'.' '{ $1=""; print $2 "." $3 }' | sort ) + $( find deployment -maxdepth 1 -mindepth 1 -name "build.*" | awk -F'.' '{ $1=""; printf $2; if ($3 != ""){ printf "." $3; } print ""; }' | sort ) ) echo -e "Valid platforms:" echo From 8e0a33c1aadabd91765594e8d9d5c3a53933b26d Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 18:01:28 -0400 Subject: [PATCH 024/115] Handle single- or triple-part platform names --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 8256f9ea31..86c8447933 100755 --- a/build.sh +++ b/build.sh @@ -24,7 +24,7 @@ usage() { list_platforms() { declare -a platforms platforms=( - $( find deployment -maxdepth 1 -mindepth 1 -name "build.*" | awk -F'.' '{ $1=""; printf $2; if ($3 != ""){ printf "." $3; } print ""; }' | sort ) + $( find deployment -maxdepth 1 -mindepth 1 -name "build.*" | awk -F'.' '{ $1=""; printf $2; if ($3 != ""){ printf "." $3; }; if ($4 != ""){ printf "." $4; }; print ""; }' | sort ) ) echo -e "Valid platforms:" echo From ab8de37080a985c742694722f311d719ec64bdc8 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 18:01:42 -0400 Subject: [PATCH 025/115] Add .tar.gz-based builds --- deployment/Dockerfile.linux.amd64 | 31 +++++++++++++++++++++++++++++++ deployment/Dockerfile.macos.amd64 | 31 +++++++++++++++++++++++++++++++ deployment/Dockerfile.portable | 30 ++++++++++++++++++++++++++++++ deployment/build.linux.amd64 | 27 +++++++++++++++++++++++++++ deployment/build.macos.amd64 | 27 +++++++++++++++++++++++++++ deployment/build.portable | 27 +++++++++++++++++++++++++++ 6 files changed, 173 insertions(+) create mode 100644 deployment/Dockerfile.linux.amd64 create mode 100644 deployment/Dockerfile.macos.amd64 create mode 100644 deployment/Dockerfile.portable create mode 100755 deployment/build.linux.amd64 create mode 100755 deployment/build.macos.amd64 create mode 100755 deployment/build.portable diff --git a/deployment/Dockerfile.linux.amd64 b/deployment/Dockerfile.linux.amd64 new file mode 100644 index 0000000000..d8bec92145 --- /dev/null +++ b/deployment/Dockerfile.linux.amd64 @@ -0,0 +1,31 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 +ENV IS_DOCKER=YES + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Link to docker-build script +RUN ln -sf ${SOURCE_DIR}/deployment/build.linux.amd64 /build.sh + +VOLUME ${SOURCE_DIR}/ + +VOLUME ${ARTIFACT_DIR}/ + +ENTRYPOINT ["/build.sh"] diff --git a/deployment/Dockerfile.macos.amd64 b/deployment/Dockerfile.macos.amd64 new file mode 100644 index 0000000000..aaf9a9692f --- /dev/null +++ b/deployment/Dockerfile.macos.amd64 @@ -0,0 +1,31 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 +ENV IS_DOCKER=YES + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Link to docker-build script +RUN ln -sf ${SOURCE_DIR}/deployment/build.macos.amd64 /build.sh + +VOLUME ${SOURCE_DIR}/ + +VOLUME ${ARTIFACT_DIR}/ + +ENTRYPOINT ["/build.sh"] diff --git a/deployment/Dockerfile.portable b/deployment/Dockerfile.portable new file mode 100644 index 0000000000..2893e140df --- /dev/null +++ b/deployment/Dockerfile.portable @@ -0,0 +1,30 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV IS_DOCKER=YES + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Link to docker-build script +RUN ln -sf ${SOURCE_DIR}/deployment/build.portable /build.sh + +VOLUME ${SOURCE_DIR}/ + +VOLUME ${ARTIFACT_DIR}/ + +ENTRYPOINT ["/build.sh"] diff --git a/deployment/build.linux.amd64 b/deployment/build.linux.amd64 new file mode 100755 index 0000000000..0cbbd05cf9 --- /dev/null +++ b/deployment/build.linux.amd64 @@ -0,0 +1,27 @@ +#!/bin/bash + +#= Generic Linux amd64 .tar.gz + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Get version +version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" + +# Build archives +dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime linux-x64 --output dist/jellyfin-server_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true" +tar -czf jellyfin-server_${version}_linux-amd64.tar.gz -C dist jellyfin-server_${version} +rm -rf dist/jellyfin-server_${version} + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/ +mv jellyfin[-_]*.tar.gz ${ARTIFACT_DIR}/ + +if [[ ${IS_DOCKER} == YES ]]; then + chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} +fi + +popd diff --git a/deployment/build.macos.amd64 b/deployment/build.macos.amd64 new file mode 100755 index 0000000000..4dca2b6438 --- /dev/null +++ b/deployment/build.macos.amd64 @@ -0,0 +1,27 @@ +#!/bin/bash + +#= MacOS 10.13+ amd64 .tar.gz + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Get version +version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" + +# Build archives +dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime osx-x64 --output dist/jellyfin-server_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true" +tar -czf jellyfin-server_${version}_macos-amd64.tar.gz -C dist jellyfin-server_${version} +rm -rf dist/jellyfin-server_${version} + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/ +mv jellyfin[-_]*.tar.gz ${ARTIFACT_DIR}/ + +if [[ ${IS_DOCKER} == YES ]]; then + chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} +fi + +popd diff --git a/deployment/build.portable b/deployment/build.portable new file mode 100755 index 0000000000..1e8a4ab623 --- /dev/null +++ b/deployment/build.portable @@ -0,0 +1,27 @@ +#!/bin/bash + +#= Portable .NET DLL .tar.gz + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Get version +version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" + +# Build archives +dotnet publish Jellyfin.Server --configuration Release --output dist/jellyfin-server_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true" +tar -czf jellyfin-server_${version}_portable.tar.gz -C dist jellyfin-server_${version} +rm -rf dist/jellyfin-server_${version} + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/ +mv jellyfin[-_]*.tar.gz ${ARTIFACT_DIR}/ + +if [[ ${IS_DOCKER} == YES ]]; then + chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} +fi + +popd From 0242ce5fee689442472505be94000233c464ffbd Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 18:10:34 -0400 Subject: [PATCH 026/115] Add Windows build --- build.yaml | 25 +++++---- deployment/Dockerfile.windows.amd64 | 30 +++++++++++ deployment/build.windows.amd64 | 54 +++++++++++++++++++ .../windows => windows}/build-jellyfin.ps1 | 0 .../old/windows => windows}/dependencies.txt | 0 .../dialogs/confirmation.nsddef | 0 .../dialogs/confirmation.nsdinc | 0 .../dialogs/service-config.nsddef | 0 .../dialogs/service-config.nsdinc | 0 .../dialogs/setuptype.nsddef | 0 .../dialogs/setuptype.nsdinc | 0 .../windows => windows}/helpers/ShowError.nsh | 0 .../windows => windows}/helpers/StrSlash.nsh | 0 .../old/windows => windows}/jellyfin.nsi | 0 .../legacy/install-jellyfin.ps1 | 0 .../windows => windows}/legacy/install.bat | 0 16 files changed, 96 insertions(+), 13 deletions(-) create mode 100644 deployment/Dockerfile.windows.amd64 create mode 100755 deployment/build.windows.amd64 rename {deployment/old/windows => windows}/build-jellyfin.ps1 (100%) rename {deployment/old/windows => windows}/dependencies.txt (100%) rename {deployment/old/windows => windows}/dialogs/confirmation.nsddef (100%) rename {deployment/old/windows => windows}/dialogs/confirmation.nsdinc (100%) rename {deployment/old/windows => windows}/dialogs/service-config.nsddef (100%) rename {deployment/old/windows => windows}/dialogs/service-config.nsdinc (100%) rename {deployment/old/windows => windows}/dialogs/setuptype.nsddef (100%) rename {deployment/old/windows => windows}/dialogs/setuptype.nsdinc (100%) rename {deployment/old/windows => windows}/helpers/ShowError.nsh (100%) rename {deployment/old/windows => windows}/helpers/StrSlash.nsh (100%) rename {deployment/old/windows => windows}/jellyfin.nsi (100%) rename {deployment/old/windows => windows}/legacy/install-jellyfin.ps1 (100%) rename {deployment/old/windows => windows}/legacy/install.bat (100%) diff --git a/build.yaml b/build.yaml index 123f77fb89..a76539d1f3 100644 --- a/build.yaml +++ b/build.yaml @@ -1,18 +1,17 @@ --- # We just wrap `build` so this is really it name: "jellyfin" -version: "10.5.0" +version: "10.6.0" packages: - - debian-package-x64 - - debian-package-armhf - - debian-package-arm64 - - ubuntu-package-x64 - - ubuntu-package-armhf - - ubuntu-package-arm64 - - fedora-package-x64 - - centos-package-x64 - - linux-x64 - - macos + - debian.amd64 + - debian.arm64 + - debian.armhf + - ubuntu.amd64 + - ubuntu.arm64 + - ubuntu.armhf + - fedora.amd64 + - centos.amd64 + - linux.amd64 + - macos.amd64 + - windows.amd64 - portable - - win-x64 - - win-x86 diff --git a/deployment/Dockerfile.windows.amd64 b/deployment/Dockerfile.windows.amd64 new file mode 100644 index 0000000000..0397a023e2 --- /dev/null +++ b/deployment/Dockerfile.windows.amd64 @@ -0,0 +1,30 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV IS_DOCKER=YES + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 zip + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Link to docker-build script +RUN ln -sf ${SOURCE_DIR}/deployment/build.windows.amd64 /build.sh + +VOLUME ${SOURCE_DIR}/ + +VOLUME ${ARTIFACT_DIR}/ + +ENTRYPOINT ["/build.sh"] diff --git a/deployment/build.windows.amd64 b/deployment/build.windows.amd64 new file mode 100755 index 0000000000..39bd41f990 --- /dev/null +++ b/deployment/build.windows.amd64 @@ -0,0 +1,54 @@ +#!/bin/bash + +#= Windows 7+ amd64 (x64) .zip + +set -o errexit +set -o xtrace + +# Version variables +NSSM_VERSION="nssm-2.24-101-g897c7ad" +NSSM_URL="http://files.evilt.win/nssm/${NSSM_VERSION}.zip" +FFMPEG_VERSION="ffmpeg-4.2.1-win64-static" +FFMPEG_URL="https://ffmpeg.zeranoe.com/builds/win64/static/${FFMPEG_VERSION}.zip" + +# Move to source directory +pushd ${SOURCE_DIR} + +# Get version +version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" + +output_dir="dist/jellyfin-server_${version}" + +# Build binary +dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime win-x64 --output ${output_dir}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true" + +# Prepare addins +addin_build_dir="$( mktemp -d )" +wget ${NSSM_URL} -O ${addin_build_dir}/nssm.zip +wget ${FFMPEG_URL} -O ${addin_build_dir}/ffmpeg.zip +unzip ${addin_build_dir}/nssm.zip -d ${addin_build_dir} +cp ${addin_build_dir}/${NSSM_VERSION}/win64/nssm.exe ${output_dir}/nssm.exe +unzip ${addin_build_dir}/ffmpeg.zip -d ${addin_build_dir} +cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffmpeg.exe ${output_dir}/ffmpeg.exe +cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffprobe.exe ${output_dir}/ffprobe.exe +rm -rf ${addin_build_dir} + +# Prepare scripts +cp ${SOURCE_DIR}/windows/legacy/install-jellyfin.ps1 ${output_dir}/install-jellyfin.ps1 +cp ${SOURCE_DIR}/windows/legacy/install.bat ${output_dir}/install.bat + +# Create zip package +pushd dist +zip -qr jellyfin-server_${version}.portable.zip jellyfin-server_${version} +popd +rm -rf ${output_dir} + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/ +mv dist/jellyfin[-_]*.zip ${ARTIFACT_DIR}/ + +if [[ ${IS_DOCKER} == YES ]]; then + chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} +fi + +popd diff --git a/deployment/old/windows/build-jellyfin.ps1 b/windows/build-jellyfin.ps1 similarity index 100% rename from deployment/old/windows/build-jellyfin.ps1 rename to windows/build-jellyfin.ps1 diff --git a/deployment/old/windows/dependencies.txt b/windows/dependencies.txt similarity index 100% rename from deployment/old/windows/dependencies.txt rename to windows/dependencies.txt diff --git a/deployment/old/windows/dialogs/confirmation.nsddef b/windows/dialogs/confirmation.nsddef similarity index 100% rename from deployment/old/windows/dialogs/confirmation.nsddef rename to windows/dialogs/confirmation.nsddef diff --git a/deployment/old/windows/dialogs/confirmation.nsdinc b/windows/dialogs/confirmation.nsdinc similarity index 100% rename from deployment/old/windows/dialogs/confirmation.nsdinc rename to windows/dialogs/confirmation.nsdinc diff --git a/deployment/old/windows/dialogs/service-config.nsddef b/windows/dialogs/service-config.nsddef similarity index 100% rename from deployment/old/windows/dialogs/service-config.nsddef rename to windows/dialogs/service-config.nsddef diff --git a/deployment/old/windows/dialogs/service-config.nsdinc b/windows/dialogs/service-config.nsdinc similarity index 100% rename from deployment/old/windows/dialogs/service-config.nsdinc rename to windows/dialogs/service-config.nsdinc diff --git a/deployment/old/windows/dialogs/setuptype.nsddef b/windows/dialogs/setuptype.nsddef similarity index 100% rename from deployment/old/windows/dialogs/setuptype.nsddef rename to windows/dialogs/setuptype.nsddef diff --git a/deployment/old/windows/dialogs/setuptype.nsdinc b/windows/dialogs/setuptype.nsdinc similarity index 100% rename from deployment/old/windows/dialogs/setuptype.nsdinc rename to windows/dialogs/setuptype.nsdinc diff --git a/deployment/old/windows/helpers/ShowError.nsh b/windows/helpers/ShowError.nsh similarity index 100% rename from deployment/old/windows/helpers/ShowError.nsh rename to windows/helpers/ShowError.nsh diff --git a/deployment/old/windows/helpers/StrSlash.nsh b/windows/helpers/StrSlash.nsh similarity index 100% rename from deployment/old/windows/helpers/StrSlash.nsh rename to windows/helpers/StrSlash.nsh diff --git a/deployment/old/windows/jellyfin.nsi b/windows/jellyfin.nsi similarity index 100% rename from deployment/old/windows/jellyfin.nsi rename to windows/jellyfin.nsi diff --git a/deployment/old/windows/legacy/install-jellyfin.ps1 b/windows/legacy/install-jellyfin.ps1 similarity index 100% rename from deployment/old/windows/legacy/install-jellyfin.ps1 rename to windows/legacy/install-jellyfin.ps1 diff --git a/deployment/old/windows/legacy/install.bat b/windows/legacy/install.bat similarity index 100% rename from deployment/old/windows/legacy/install.bat rename to windows/legacy/install.bat From 9169861baab62919e661ec663998c5a4436e4547 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 18:18:38 -0400 Subject: [PATCH 027/115] Add CODEOWNERS for GitHub --- .github/CODEOWNERS | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000..e902dc7124 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +# Joshua must review all changes to deployment and build.sh +deployment/* @joshuaboniface +build.sh @joshuaboniface From de66ab4d832664abb5c17005d326e543446aae7d Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 18:39:11 -0400 Subject: [PATCH 028/115] Use git checkout instead of file copies to clean --- deployment/Dockerfile.debian.amd64 | 2 +- deployment/Dockerfile.debian.arm64 | 2 +- deployment/Dockerfile.debian.armhf | 2 +- deployment/Dockerfile.ubuntu.amd64 | 2 +- deployment/Dockerfile.ubuntu.arm64 | 2 +- deployment/Dockerfile.ubuntu.armhf | 2 +- deployment/build.debian.amd64 | 2 +- deployment/build.debian.arm64 | 2 +- deployment/build.debian.armhf | 2 +- deployment/build.ubuntu.amd64 | 2 +- deployment/build.ubuntu.arm64 | 2 +- deployment/build.ubuntu.armhf | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/deployment/Dockerfile.debian.amd64 b/deployment/Dockerfile.debian.amd64 index b5a0380489..ea2aba5a89 100644 --- a/deployment/Dockerfile.debian.amd64 +++ b/deployment/Dockerfile.debian.amd64 @@ -12,7 +12,7 @@ ENV IS_DOCKER=YES # Prepare Debian build environment RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 git # Install dotnet repository # https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current diff --git a/deployment/Dockerfile.debian.arm64 b/deployment/Dockerfile.debian.arm64 index cfe562df33..db8485b43d 100644 --- a/deployment/Dockerfile.debian.arm64 +++ b/deployment/Dockerfile.debian.arm64 @@ -12,7 +12,7 @@ ENV IS_DOCKER=YES # Prepare Debian build environment RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv git # Install dotnet repository # https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current diff --git a/deployment/Dockerfile.debian.armhf b/deployment/Dockerfile.debian.armhf index ea8c8c8e62..717bc3c894 100644 --- a/deployment/Dockerfile.debian.armhf +++ b/deployment/Dockerfile.debian.armhf @@ -12,7 +12,7 @@ ENV IS_DOCKER=YES # Prepare Debian build environment RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv git # Install dotnet repository # https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current diff --git a/deployment/Dockerfile.ubuntu.amd64 b/deployment/Dockerfile.ubuntu.amd64 index e61be4efcc..7c2b26dedd 100644 --- a/deployment/Dockerfile.ubuntu.amd64 +++ b/deployment/Dockerfile.ubuntu.amd64 @@ -12,7 +12,7 @@ ENV IS_DOCKER=YES # Prepare Debian build environment RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 git # Install dotnet repository # https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current diff --git a/deployment/Dockerfile.ubuntu.arm64 b/deployment/Dockerfile.ubuntu.arm64 index e34ef7edd1..27f8ec11b5 100644 --- a/deployment/Dockerfile.ubuntu.arm64 +++ b/deployment/Dockerfile.ubuntu.arm64 @@ -12,7 +12,7 @@ ENV IS_DOCKER=YES # Prepare Debian build environment RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv git # Install dotnet repository # https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current diff --git a/deployment/Dockerfile.ubuntu.armhf b/deployment/Dockerfile.ubuntu.armhf index 6f92c81ab1..c888c42df6 100644 --- a/deployment/Dockerfile.ubuntu.armhf +++ b/deployment/Dockerfile.ubuntu.armhf @@ -12,7 +12,7 @@ ENV IS_DOCKER=YES # Prepare Debian build environment RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv git # Install dotnet repository # https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current diff --git a/deployment/build.debian.amd64 b/deployment/build.debian.amd64 index 0eb9ee5c83..8e205867b8 100755 --- a/deployment/build.debian.amd64 +++ b/deployment/build.debian.amd64 @@ -21,7 +21,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then - mv debian/control.orig debian/control + git checkout debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi diff --git a/deployment/build.debian.arm64 b/deployment/build.debian.arm64 index d1ce85e2fa..436602d195 100755 --- a/deployment/build.debian.arm64 +++ b/deployment/build.debian.arm64 @@ -22,7 +22,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then - mv debian/control.orig debian/control + git checkout debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi diff --git a/deployment/build.debian.armhf b/deployment/build.debian.armhf index 3941583544..9ca57b1e46 100755 --- a/deployment/build.debian.armhf +++ b/deployment/build.debian.armhf @@ -22,7 +22,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then - mv debian/control.orig debian/control + git checkout debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi diff --git a/deployment/build.ubuntu.amd64 b/deployment/build.ubuntu.amd64 index 86653cb384..2b789cc475 100755 --- a/deployment/build.ubuntu.amd64 +++ b/deployment/build.ubuntu.amd64 @@ -21,7 +21,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then - mv debian/control.orig debian/control + git checkout debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi diff --git a/deployment/build.ubuntu.arm64 b/deployment/build.ubuntu.arm64 index f065170092..9b4e548501 100755 --- a/deployment/build.ubuntu.arm64 +++ b/deployment/build.ubuntu.arm64 @@ -22,7 +22,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then - mv debian/control.orig debian/control + git checkout debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi diff --git a/deployment/build.ubuntu.armhf b/deployment/build.ubuntu.armhf index 679fde5ae1..59912a14f5 100755 --- a/deployment/build.ubuntu.armhf +++ b/deployment/build.ubuntu.armhf @@ -22,7 +22,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then - mv debian/control.orig debian/control + git checkout debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi From b95bd0e67874f925918eb912d445fb202e4fcee0 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 18:42:09 -0400 Subject: [PATCH 029/115] Bump shared_version to 10.6.0 too --- SharedVersion.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index d741f379d2..6981c1ca9d 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; -[assembly: AssemblyVersion("10.5.0")] -[assembly: AssemblyFileVersion("10.5.0")] +[assembly: AssemblyVersion("10.6.0")] +[assembly: AssemblyFileVersion("10.6.0")] From a561d4ca417b45e983bfe46a70397fb44f7b78a3 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 18:43:54 -0400 Subject: [PATCH 030/115] Remove arch from macos --- build.yaml | 2 +- deployment/{Dockerfile.macos.amd64 => Dockerfile.macos} | 2 +- deployment/{build.macos.amd64 => build.macos} | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename deployment/{Dockerfile.macos.amd64 => Dockerfile.macos} (94%) rename deployment/{build.macos.amd64 => build.macos} (96%) diff --git a/build.yaml b/build.yaml index a76539d1f3..9e590e5a01 100644 --- a/build.yaml +++ b/build.yaml @@ -12,6 +12,6 @@ packages: - fedora.amd64 - centos.amd64 - linux.amd64 - - macos.amd64 - windows.amd64 + - macos - portable diff --git a/deployment/Dockerfile.macos.amd64 b/deployment/Dockerfile.macos similarity index 94% rename from deployment/Dockerfile.macos.amd64 rename to deployment/Dockerfile.macos index aaf9a9692f..ba5da40190 100644 --- a/deployment/Dockerfile.macos.amd64 +++ b/deployment/Dockerfile.macos @@ -22,7 +22,7 @@ RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4 && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet # Link to docker-build script -RUN ln -sf ${SOURCE_DIR}/deployment/build.macos.amd64 /build.sh +RUN ln -sf ${SOURCE_DIR}/deployment/build.macos /build.sh VOLUME ${SOURCE_DIR}/ diff --git a/deployment/build.macos.amd64 b/deployment/build.macos similarity index 96% rename from deployment/build.macos.amd64 rename to deployment/build.macos index 4dca2b6438..16be29eeef 100755 --- a/deployment/build.macos.amd64 +++ b/deployment/build.macos @@ -1,6 +1,6 @@ #!/bin/bash -#= MacOS 10.13+ amd64 .tar.gz +#= MacOS 10.13+ .tar.gz set -o errexit set -o xtrace From c478a43fd56993062622c3252be938b01e80854c Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 21:44:33 -0400 Subject: [PATCH 031/115] Update package description for Debian --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index f473dc41d2..648e28ae81 100644 --- a/debian/control +++ b/debian/control @@ -26,5 +26,5 @@ Depends: at, libfreetype6, libssl1.1 Recommends: jellyfin-web -Description: Jellyfin is a home media server. - It is built on top of other popular open source technologies such as Service Stack, jQuery, jQuery mobile, and Mono. It features a REST-based api with built-in documentation to facilitate client development. We also have client libraries for our api to enable rapid development. +Description: Jellyfin is the Free Software Media System. + This package provides the Jellyfin server backend and API. From e87a10235b960bf28a6a76da762b62a0f0399e2c Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 21:49:07 -0400 Subject: [PATCH 032/115] Go back to cp-based control archive but right --- deployment/Dockerfile.debian.amd64 | 2 +- deployment/Dockerfile.debian.arm64 | 2 +- deployment/Dockerfile.debian.armhf | 2 +- deployment/Dockerfile.ubuntu.amd64 | 2 +- deployment/Dockerfile.ubuntu.arm64 | 2 +- deployment/Dockerfile.ubuntu.armhf | 2 +- deployment/build.debian.amd64 | 4 ++-- deployment/build.debian.arm64 | 4 ++-- deployment/build.debian.armhf | 4 ++-- deployment/build.ubuntu.amd64 | 4 ++-- deployment/build.ubuntu.arm64 | 4 ++-- deployment/build.ubuntu.armhf | 4 ++-- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/deployment/Dockerfile.debian.amd64 b/deployment/Dockerfile.debian.amd64 index ea2aba5a89..b5a0380489 100644 --- a/deployment/Dockerfile.debian.amd64 +++ b/deployment/Dockerfile.debian.amd64 @@ -12,7 +12,7 @@ ENV IS_DOCKER=YES # Prepare Debian build environment RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 git + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 # Install dotnet repository # https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current diff --git a/deployment/Dockerfile.debian.arm64 b/deployment/Dockerfile.debian.arm64 index db8485b43d..cfe562df33 100644 --- a/deployment/Dockerfile.debian.arm64 +++ b/deployment/Dockerfile.debian.arm64 @@ -12,7 +12,7 @@ ENV IS_DOCKER=YES # Prepare Debian build environment RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv git + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv # Install dotnet repository # https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current diff --git a/deployment/Dockerfile.debian.armhf b/deployment/Dockerfile.debian.armhf index 717bc3c894..ea8c8c8e62 100644 --- a/deployment/Dockerfile.debian.armhf +++ b/deployment/Dockerfile.debian.armhf @@ -12,7 +12,7 @@ ENV IS_DOCKER=YES # Prepare Debian build environment RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv git + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv # Install dotnet repository # https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current diff --git a/deployment/Dockerfile.ubuntu.amd64 b/deployment/Dockerfile.ubuntu.amd64 index 7c2b26dedd..e61be4efcc 100644 --- a/deployment/Dockerfile.ubuntu.amd64 +++ b/deployment/Dockerfile.ubuntu.amd64 @@ -12,7 +12,7 @@ ENV IS_DOCKER=YES # Prepare Debian build environment RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 git + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 # Install dotnet repository # https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current diff --git a/deployment/Dockerfile.ubuntu.arm64 b/deployment/Dockerfile.ubuntu.arm64 index 27f8ec11b5..e34ef7edd1 100644 --- a/deployment/Dockerfile.ubuntu.arm64 +++ b/deployment/Dockerfile.ubuntu.arm64 @@ -12,7 +12,7 @@ ENV IS_DOCKER=YES # Prepare Debian build environment RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv git + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv # Install dotnet repository # https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current diff --git a/deployment/Dockerfile.ubuntu.armhf b/deployment/Dockerfile.ubuntu.armhf index c888c42df6..6f92c81ab1 100644 --- a/deployment/Dockerfile.ubuntu.armhf +++ b/deployment/Dockerfile.ubuntu.armhf @@ -12,7 +12,7 @@ ENV IS_DOCKER=YES # Prepare Debian build environment RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv git + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv # Install dotnet repository # https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current diff --git a/deployment/build.debian.amd64 b/deployment/build.debian.amd64 index 8e205867b8..beaf02bee2 100755 --- a/deployment/build.debian.amd64 +++ b/deployment/build.debian.amd64 @@ -10,7 +10,7 @@ pushd ${SOURCE_DIR} if [[ ${IS_DOCKER} == YES ]]; then # Remove build-dep for dotnet-sdk-3.1, since it's installed manually - cp debian/control debian/control.orig + cp -a debian/control /tmp/control.orig sed -i '/dotnet-sdk-3.1,/d' debian/control fi @@ -21,7 +21,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then - git checkout debian/control + cp -a /tmp/control.orig debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi diff --git a/deployment/build.debian.arm64 b/deployment/build.debian.arm64 index 436602d195..6394dddb02 100755 --- a/deployment/build.debian.arm64 +++ b/deployment/build.debian.arm64 @@ -10,7 +10,7 @@ pushd ${SOURCE_DIR} if [[ ${IS_DOCKER} == YES ]]; then # Remove build-dep for dotnet-sdk-3.1, since it's installed manually - cp debian/control debian/control.orig + cp -a debian/control /tmp/control.orig sed -i '/dotnet-sdk-3.1,/d' debian/control fi @@ -22,7 +22,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then - git checkout debian/control + cp -a /tmp/control.orig debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi diff --git a/deployment/build.debian.armhf b/deployment/build.debian.armhf index 9ca57b1e46..d12660760f 100755 --- a/deployment/build.debian.armhf +++ b/deployment/build.debian.armhf @@ -10,7 +10,7 @@ pushd ${SOURCE_DIR} if [[ ${IS_DOCKER} == YES ]]; then # Remove build-dep for dotnet-sdk-3.1, since it's installed manually - cp debian/control debian/control.orig + cp -a debian/control /tmp/control.orig sed -i '/dotnet-sdk-3.1,/d' debian/control fi @@ -22,7 +22,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then - git checkout debian/control + cp -a /tmp/control.orig debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi diff --git a/deployment/build.ubuntu.amd64 b/deployment/build.ubuntu.amd64 index 2b789cc475..1b90f68f46 100755 --- a/deployment/build.ubuntu.amd64 +++ b/deployment/build.ubuntu.amd64 @@ -10,7 +10,7 @@ pushd ${SOURCE_DIR} if [[ ${IS_DOCKER} == YES ]]; then # Remove build-dep for dotnet-sdk-3.1, since it's installed manually - cp debian/control debian/control.orig + cp -a debian/control /tmp/control.orig sed -i '/dotnet-sdk-3.1,/d' debian/control fi @@ -21,7 +21,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then - git checkout debian/control + cp -a /tmp/control.orig debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi diff --git a/deployment/build.ubuntu.arm64 b/deployment/build.ubuntu.arm64 index 9b4e548501..c0a31d764f 100755 --- a/deployment/build.ubuntu.arm64 +++ b/deployment/build.ubuntu.arm64 @@ -10,7 +10,7 @@ pushd ${SOURCE_DIR} if [[ ${IS_DOCKER} == YES ]]; then # Remove build-dep for dotnet-sdk-3.1, since it's installed manually - cp debian/control debian/control.orig + cp -a debian/control /tmp/control.orig sed -i '/dotnet-sdk-3.1,/d' debian/control fi @@ -22,7 +22,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then - git checkout debian/control + cp -a /tmp/control.orig debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi diff --git a/deployment/build.ubuntu.armhf b/deployment/build.ubuntu.armhf index 59912a14f5..e2129357dd 100755 --- a/deployment/build.ubuntu.armhf +++ b/deployment/build.ubuntu.armhf @@ -10,7 +10,7 @@ pushd ${SOURCE_DIR} if [[ ${IS_DOCKER} == YES ]]; then # Remove build-dep for dotnet-sdk-3.1, since it's installed manually - cp debian/control debian/control.orig + cp -a debian/control /tmp/control.orig sed -i '/dotnet-sdk-3.1,/d' debian/control fi @@ -22,7 +22,7 @@ mkdir -p ${ARTIFACT_DIR}/ mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then - git checkout debian/control + cp -a /tmp/control.orig debian/control chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} fi From be9eb0f19ed207cabaad48c5b713ac80d9d77397 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 22:51:12 -0400 Subject: [PATCH 033/115] Unify dep installation and update --- deployment/Dockerfile.fedora.amd64 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/deployment/Dockerfile.fedora.amd64 b/deployment/Dockerfile.fedora.amd64 index 73148763de..01b99deb6d 100644 --- a/deployment/Dockerfile.fedora.amd64 +++ b/deployment/Dockerfile.fedora.amd64 @@ -9,10 +9,8 @@ ENV ARTIFACT_DIR=/dist ENV IS_DOCKER=YES # Prepare Fedora environment -RUN dnf update -y - -# Install build dependencies -RUN dnf install -y @buildsys-build rpmdevtools git dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel +RUN dnf update -y \ + && dnf install -y @buildsys-build rpmdevtools git dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel # Install DotNET SDK RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \ From fc5e9324920f5c4bf1341ff99b4e8fd2c07069ef Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 22:55:37 -0400 Subject: [PATCH 034/115] Fix makefile formatting --- fedora/Makefile | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/fedora/Makefile b/fedora/Makefile index 1d2709a2fe..5a76d7d944 100644 --- a/fedora/Makefile +++ b/fedora/Makefile @@ -2,27 +2,27 @@ VERSION := $(shell sed -ne '/^Version:/s/.* *//p' fedora/jellyfin.spec) srpm: cd fedora/; \ - SOURCE_DIR=.. \ - WORKDIR="$${PWD}"; \ - package_temporary_dir="$${WORKDIR}/pkg-dist-tmp"; \ - pkg_src_dir="$${WORKDIR}"; \ - GNU_TAR=1; \ - tar \ - --transform "s,^\.,jellyfin-server-$(VERSION)," \ - --exclude='.git*' \ - --exclude='**/.git' \ - --exclude='**/.hg' \ - --exclude='**/.vs' \ - --exclude='**/.vscode' \ - --exclude='deployment' \ - --exclude='**/bin' \ - --exclude='**/obj' \ - --exclude='**/.nuget' \ - --exclude='*.deb' \ - --exclude='*.rpm' \ - --exclude='jellyfin-server-$(VERSION).tar.gz' \ - -czf "jellyfin-server-$(VERSION).tar.gz" \ - -C $${SOURCE_DIR} ./ + SOURCE_DIR=.. \ + WORKDIR="$${PWD}"; \ + package_temporary_dir="$${WORKDIR}/pkg-dist-tmp"; \ + pkg_src_dir="$${WORKDIR}"; \ + GNU_TAR=1; \ + tar \ + --transform "s,^\.,jellyfin-server-$(VERSION)," \ + --exclude='.git*' \ + --exclude='**/.git' \ + --exclude='**/.hg' \ + --exclude='**/.vs' \ + --exclude='**/.vscode' \ + --exclude='deployment' \ + --exclude='**/bin' \ + --exclude='**/obj' \ + --exclude='**/.nuget' \ + --exclude='*.deb' \ + --exclude='*.rpm' \ + --exclude='jellyfin-server-$(VERSION).tar.gz' \ + -czf "jellyfin-server-$(VERSION).tar.gz" \ + -C $${SOURCE_DIR} ./ cd fedora/; \ rpmbuild -bs jellyfin.spec \ --define "_sourcedir $$PWD/" \ From 891aa7c25585dacc490590bc7337b00161a781e6 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 23 Mar 2020 23:00:35 -0400 Subject: [PATCH 035/115] Update info in Fedora spec --- fedora/jellyfin.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fedora/jellyfin.spec b/fedora/jellyfin.spec index e6a3170b56..c15b4ee957 100644 --- a/fedora/jellyfin.spec +++ b/fedora/jellyfin.spec @@ -9,8 +9,8 @@ Name: jellyfin-server Version: 10.6.0 Release: 1%{?dist} -Summary: The Free Software Media Browser -License: GPLv2 +Summary: The Free Software Media System Server backend and API +License: GPLv3 URL: https://jellyfin.media # Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%{version}.tar.gz` Source0: jellyfin-server-%{version}.tar.gz From 05aa28a37729e73b99cca2892b34590e456a9f07 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 24 Mar 2020 00:01:48 -0400 Subject: [PATCH 036/115] Clean up redundant Makefile steps --- fedora/Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/fedora/Makefile b/fedora/Makefile index 5a76d7d944..97904ddd35 100644 --- a/fedora/Makefile +++ b/fedora/Makefile @@ -4,9 +4,6 @@ srpm: cd fedora/; \ SOURCE_DIR=.. \ WORKDIR="$${PWD}"; \ - package_temporary_dir="$${WORKDIR}/pkg-dist-tmp"; \ - pkg_src_dir="$${WORKDIR}"; \ - GNU_TAR=1; \ tar \ --transform "s,^\.,jellyfin-server-$(VERSION)," \ --exclude='.git*' \ From b9fdd96ece39a6ff0f4ff37ecba36d7a0f65fcba Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 24 Mar 2020 01:10:29 -0400 Subject: [PATCH 037/115] Remove old stuff --- deployment/old/README.md | 62 ------ deployment/old/centos-package-x64/Dockerfile | 39 ---- deployment/old/centos-package-x64/clean.sh | 32 ---- .../old/centos-package-x64/dependencies.txt | 1 - .../old/centos-package-x64/docker-build.sh | 18 -- deployment/old/centos-package-x64/package.sh | 34 ---- deployment/old/centos-package-x64/pkg-src | 1 - .../old/debian-package-arm64/Dockerfile.amd64 | 43 ----- .../old/debian-package-arm64/Dockerfile.arm64 | 34 ---- deployment/old/debian-package-arm64/clean.sh | 27 --- .../old/debian-package-arm64/dependencies.txt | 1 - .../old/debian-package-arm64/docker-build.sh | 21 -- .../old/debian-package-arm64/package.sh | 45 ----- deployment/old/debian-package-arm64/pkg-src | 1 - .../old/debian-package-armhf/Dockerfile.amd64 | 42 ---- .../old/debian-package-armhf/Dockerfile.armhf | 34 ---- deployment/old/debian-package-armhf/clean.sh | 27 --- .../old/debian-package-armhf/dependencies.txt | 1 - .../old/debian-package-armhf/docker-build.sh | 21 -- .../old/debian-package-armhf/package.sh | 45 ----- deployment/old/debian-package-armhf/pkg-src | 1 - deployment/old/debian-package-x64/Dockerfile | 34 ---- deployment/old/debian-package-x64/clean.sh | 27 --- .../old/debian-package-x64/dependencies.txt | 1 - .../old/debian-package-x64/docker-build.sh | 20 -- deployment/old/debian-package-x64/package.sh | 34 ---- .../old/debian-package-x64/pkg-src/changelog | 59 ------ .../old/debian-package-x64/pkg-src/compat | 1 - .../debian-package-x64/pkg-src/conf/jellyfin | 40 ---- .../pkg-src/conf/jellyfin-sudoers | 37 ---- .../pkg-src/conf/jellyfin.service.conf | 7 - .../pkg-src/conf/logging.json | 30 --- .../old/debian-package-x64/pkg-src/control | 31 --- .../old/debian-package-x64/pkg-src/copyright | 29 --- .../old/debian-package-x64/pkg-src/gbp.conf | 6 - .../old/debian-package-x64/pkg-src/install | 6 - .../debian-package-x64/pkg-src/jellyfin.init | 61 ------ .../pkg-src/jellyfin.service | 14 -- .../pkg-src/jellyfin.upstart | 20 -- .../debian-package-x64/pkg-src/po/POTFILES.in | 1 - .../pkg-src/po/templates.pot | 57 ------ .../old/debian-package-x64/pkg-src/postinst | 92 --------- .../old/debian-package-x64/pkg-src/postrm | 81 -------- .../old/debian-package-x64/pkg-src/preinst | 78 -------- .../old/debian-package-x64/pkg-src/prerm | 61 ------ .../old/debian-package-x64/pkg-src/rules | 66 ------- .../pkg-src/source.lintian-overrides | 3 - .../debian-package-x64/pkg-src/source/format | 1 - .../debian-package-x64/pkg-src/source/options | 11 -- deployment/old/fedora-package-x64/Dockerfile | 33 ---- deployment/old/fedora-package-x64/clean.sh | 32 ---- .../old/fedora-package-x64/dependencies.txt | 1 - .../old/fedora-package-x64/docker-build.sh | 18 -- deployment/old/fedora-package-x64/package.sh | 34 ---- .../old/fedora-package-x64/pkg-src/.gitignore | 3 - .../old/fedora-package-x64/pkg-src/README.md | 43 ----- .../pkg-src/jellyfin-firewalld.xml | 9 - .../fedora-package-x64/pkg-src/jellyfin.env | 34 ---- .../pkg-src/jellyfin.override.conf | 7 - .../pkg-src/jellyfin.service | 15 -- .../fedora-package-x64/pkg-src/jellyfin.spec | 181 ------------------ .../pkg-src/jellyfin.sudoers | 19 -- .../old/fedora-package-x64/pkg-src/restart.sh | 36 ---- deployment/old/linux-x64/Dockerfile | 37 ---- deployment/old/linux-x64/clean.sh | 27 --- deployment/old/linux-x64/dependencies.txt | 1 - deployment/old/linux-x64/docker-build.sh | 36 ---- deployment/old/linux-x64/package.sh | 34 ---- deployment/old/macos/Dockerfile | 37 ---- deployment/old/macos/clean.sh | 27 --- deployment/old/macos/dependencies.txt | 1 - deployment/old/macos/docker-build.sh | 36 ---- deployment/old/macos/package.sh | 34 ---- deployment/old/portable/Dockerfile | 37 ---- deployment/old/portable/clean.sh | 27 --- deployment/old/portable/dependencies.txt | 1 - deployment/old/portable/docker-build.sh | 36 ---- deployment/old/portable/package.sh | 34 ---- .../old/ubuntu-package-arm64/Dockerfile.amd64 | 59 ------ .../old/ubuntu-package-arm64/Dockerfile.arm64 | 40 ---- deployment/old/ubuntu-package-arm64/clean.sh | 27 --- .../old/ubuntu-package-arm64/dependencies.txt | 1 - .../old/ubuntu-package-arm64/docker-build.sh | 21 -- .../old/ubuntu-package-arm64/package.sh | 45 ----- deployment/old/ubuntu-package-arm64/pkg-src | 1 - .../old/ubuntu-package-armhf/Dockerfile.amd64 | 59 ------ .../old/ubuntu-package-armhf/Dockerfile.armhf | 40 ---- deployment/old/ubuntu-package-armhf/clean.sh | 27 --- .../old/ubuntu-package-armhf/dependencies.txt | 1 - .../old/ubuntu-package-armhf/docker-build.sh | 21 -- .../old/ubuntu-package-armhf/package.sh | 45 ----- deployment/old/ubuntu-package-armhf/pkg-src | 1 - deployment/old/ubuntu-package-x64/Dockerfile | 36 ---- deployment/old/ubuntu-package-x64/clean.sh | 27 --- .../old/ubuntu-package-x64/dependencies.txt | 1 - .../old/ubuntu-package-x64/docker-build.sh | 20 -- deployment/old/ubuntu-package-x64/package.sh | 34 ---- deployment/old/ubuntu-package-x64/pkg-src | 1 - .../old/unraid/docker-templates/README.md | 15 -- .../old/unraid/docker-templates/jellyfin.xml | 57 ------ deployment/old/win-x64/Dockerfile | 37 ---- deployment/old/win-x64/clean.sh | 27 --- deployment/old/win-x64/dependencies.txt | 1 - deployment/old/win-x64/docker-build.sh | 61 ------ deployment/old/win-x64/package.sh | 34 ---- deployment/old/win-x86/Dockerfile | 37 ---- deployment/old/win-x86/clean.sh | 27 --- deployment/old/win-x86/dependencies.txt | 1 - deployment/old/win-x86/docker-build.sh | 61 ------ deployment/old/win-x86/package.sh | 34 ---- 110 files changed, 3207 deletions(-) delete mode 100644 deployment/old/README.md delete mode 100644 deployment/old/centos-package-x64/Dockerfile delete mode 100755 deployment/old/centos-package-x64/clean.sh delete mode 100644 deployment/old/centos-package-x64/dependencies.txt delete mode 100755 deployment/old/centos-package-x64/docker-build.sh delete mode 100755 deployment/old/centos-package-x64/package.sh delete mode 120000 deployment/old/centos-package-x64/pkg-src delete mode 100644 deployment/old/debian-package-arm64/Dockerfile.amd64 delete mode 100644 deployment/old/debian-package-arm64/Dockerfile.arm64 delete mode 100755 deployment/old/debian-package-arm64/clean.sh delete mode 100644 deployment/old/debian-package-arm64/dependencies.txt delete mode 100755 deployment/old/debian-package-arm64/docker-build.sh delete mode 100755 deployment/old/debian-package-arm64/package.sh delete mode 120000 deployment/old/debian-package-arm64/pkg-src delete mode 100644 deployment/old/debian-package-armhf/Dockerfile.amd64 delete mode 100644 deployment/old/debian-package-armhf/Dockerfile.armhf delete mode 100755 deployment/old/debian-package-armhf/clean.sh delete mode 100644 deployment/old/debian-package-armhf/dependencies.txt delete mode 100755 deployment/old/debian-package-armhf/docker-build.sh delete mode 100755 deployment/old/debian-package-armhf/package.sh delete mode 120000 deployment/old/debian-package-armhf/pkg-src delete mode 100644 deployment/old/debian-package-x64/Dockerfile delete mode 100755 deployment/old/debian-package-x64/clean.sh delete mode 100644 deployment/old/debian-package-x64/dependencies.txt delete mode 100755 deployment/old/debian-package-x64/docker-build.sh delete mode 100755 deployment/old/debian-package-x64/package.sh delete mode 100644 deployment/old/debian-package-x64/pkg-src/changelog delete mode 100644 deployment/old/debian-package-x64/pkg-src/compat delete mode 100644 deployment/old/debian-package-x64/pkg-src/conf/jellyfin delete mode 100644 deployment/old/debian-package-x64/pkg-src/conf/jellyfin-sudoers delete mode 100644 deployment/old/debian-package-x64/pkg-src/conf/jellyfin.service.conf delete mode 100644 deployment/old/debian-package-x64/pkg-src/conf/logging.json delete mode 100644 deployment/old/debian-package-x64/pkg-src/control delete mode 100644 deployment/old/debian-package-x64/pkg-src/copyright delete mode 100644 deployment/old/debian-package-x64/pkg-src/gbp.conf delete mode 100644 deployment/old/debian-package-x64/pkg-src/install delete mode 100644 deployment/old/debian-package-x64/pkg-src/jellyfin.init delete mode 100644 deployment/old/debian-package-x64/pkg-src/jellyfin.service delete mode 100644 deployment/old/debian-package-x64/pkg-src/jellyfin.upstart delete mode 100644 deployment/old/debian-package-x64/pkg-src/po/POTFILES.in delete mode 100644 deployment/old/debian-package-x64/pkg-src/po/templates.pot delete mode 100644 deployment/old/debian-package-x64/pkg-src/postinst delete mode 100644 deployment/old/debian-package-x64/pkg-src/postrm delete mode 100644 deployment/old/debian-package-x64/pkg-src/preinst delete mode 100644 deployment/old/debian-package-x64/pkg-src/prerm delete mode 100755 deployment/old/debian-package-x64/pkg-src/rules delete mode 100644 deployment/old/debian-package-x64/pkg-src/source.lintian-overrides delete mode 100644 deployment/old/debian-package-x64/pkg-src/source/format delete mode 100644 deployment/old/debian-package-x64/pkg-src/source/options delete mode 100644 deployment/old/fedora-package-x64/Dockerfile delete mode 100755 deployment/old/fedora-package-x64/clean.sh delete mode 100644 deployment/old/fedora-package-x64/dependencies.txt delete mode 100755 deployment/old/fedora-package-x64/docker-build.sh delete mode 100755 deployment/old/fedora-package-x64/package.sh delete mode 100644 deployment/old/fedora-package-x64/pkg-src/.gitignore delete mode 100644 deployment/old/fedora-package-x64/pkg-src/README.md delete mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin-firewalld.xml delete mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin.env delete mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin.override.conf delete mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin.service delete mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin.spec delete mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin.sudoers delete mode 100755 deployment/old/fedora-package-x64/pkg-src/restart.sh delete mode 100644 deployment/old/linux-x64/Dockerfile delete mode 100755 deployment/old/linux-x64/clean.sh delete mode 100644 deployment/old/linux-x64/dependencies.txt delete mode 100755 deployment/old/linux-x64/docker-build.sh delete mode 100755 deployment/old/linux-x64/package.sh delete mode 100644 deployment/old/macos/Dockerfile delete mode 100755 deployment/old/macos/clean.sh delete mode 100644 deployment/old/macos/dependencies.txt delete mode 100755 deployment/old/macos/docker-build.sh delete mode 100755 deployment/old/macos/package.sh delete mode 100644 deployment/old/portable/Dockerfile delete mode 100755 deployment/old/portable/clean.sh delete mode 100644 deployment/old/portable/dependencies.txt delete mode 100755 deployment/old/portable/docker-build.sh delete mode 100755 deployment/old/portable/package.sh delete mode 100644 deployment/old/ubuntu-package-arm64/Dockerfile.amd64 delete mode 100644 deployment/old/ubuntu-package-arm64/Dockerfile.arm64 delete mode 100755 deployment/old/ubuntu-package-arm64/clean.sh delete mode 100644 deployment/old/ubuntu-package-arm64/dependencies.txt delete mode 100755 deployment/old/ubuntu-package-arm64/docker-build.sh delete mode 100755 deployment/old/ubuntu-package-arm64/package.sh delete mode 120000 deployment/old/ubuntu-package-arm64/pkg-src delete mode 100644 deployment/old/ubuntu-package-armhf/Dockerfile.amd64 delete mode 100644 deployment/old/ubuntu-package-armhf/Dockerfile.armhf delete mode 100755 deployment/old/ubuntu-package-armhf/clean.sh delete mode 100644 deployment/old/ubuntu-package-armhf/dependencies.txt delete mode 100755 deployment/old/ubuntu-package-armhf/docker-build.sh delete mode 100755 deployment/old/ubuntu-package-armhf/package.sh delete mode 120000 deployment/old/ubuntu-package-armhf/pkg-src delete mode 100644 deployment/old/ubuntu-package-x64/Dockerfile delete mode 100755 deployment/old/ubuntu-package-x64/clean.sh delete mode 100644 deployment/old/ubuntu-package-x64/dependencies.txt delete mode 100755 deployment/old/ubuntu-package-x64/docker-build.sh delete mode 100755 deployment/old/ubuntu-package-x64/package.sh delete mode 120000 deployment/old/ubuntu-package-x64/pkg-src delete mode 100644 deployment/old/unraid/docker-templates/README.md delete mode 100644 deployment/old/unraid/docker-templates/jellyfin.xml delete mode 100644 deployment/old/win-x64/Dockerfile delete mode 100755 deployment/old/win-x64/clean.sh delete mode 100644 deployment/old/win-x64/dependencies.txt delete mode 100755 deployment/old/win-x64/docker-build.sh delete mode 100755 deployment/old/win-x64/package.sh delete mode 100644 deployment/old/win-x86/Dockerfile delete mode 100755 deployment/old/win-x86/clean.sh delete mode 100644 deployment/old/win-x86/dependencies.txt delete mode 100755 deployment/old/win-x86/docker-build.sh delete mode 100755 deployment/old/win-x86/package.sh diff --git a/deployment/old/README.md b/deployment/old/README.md deleted file mode 100644 index a805f59ca3..0000000000 --- a/deployment/old/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# Jellyfin Packaging - -This directory contains the packaging configuration of Jellyfin for multiple platforms. The specification is below; all package platforms must follow the specification to be compatable with the central `build` script. - -## Package List - -### Operating System Packages - -* `debian-package-x64`: Package for Debian and Ubuntu amd64 systems. -* `fedora-package-x64`: Package for Fedora, CentOS, and Red Hat Enterprise Linux amd64 systems. - -### Portable Builds (archives) - -* `linux-x64`: Portable binary archive for generic Linux amd64 systems. -* `macos`: Portable binary archive for MacOS amd64 systems. -* `win-x64`: Portable binary archive for Windows amd64 systems. -* `win-x86`: Portable binary archive for Windows i386 systems. - -### Other Builds - -These builds are not necessarily run from the `build` script, but are present for other platforms. - -* `portable`: Compiled `.dll` for use with .NET Core runtime on any system. -* `docker`: Docker manifests for auto-publishing. -* `unraid`: unRaid Docker template; not built by `build` but imported into unRaid directly. -* `windows`: Support files and scripts for Windows CI build. - -## Package Specification - -### Dependencies - -* If a platform requires additional build dependencies, the required binary names, i.e. to validate `which `, should be specified in a `dependencies.txt` file inside the platform directory. - -* Each dependency should be present on its own line. - -### Action Scripts - -* Actions are defined in BASH scripts with the name `.sh` within the platform directory. - -* The list of valid actions are: - - 1. `build`: Builds a set of binaries. - 2. `package`: Assembles the compiled binaries into a package. - 3. `sign`: Performs signing actions on a package. - 4. `publish`: Performs a publishing action for a package. - 5. `clean`: Cleans up any artifacts from the previous actions. - -* All package actions are optional, however at least one should generate output files, and any that do should contain a `clean` action. - -* Actions are executed in the order specified above, and later actions may depend on former actions. - -* Actions except for `clean` should `set -o errexit` to terminate on failed actions. - -* The `clean` action should always `exit 0` even if no work is done or it fails. - -* The `clean` action can be passed a variable as argument 1, named `keep_artifacts`, containing either the value `y` or `n`. It is indended to handle situations when the user runs `build --keep-artifacts` and should be handled intelligently. Usually, this is used to preserve Docker images while still removing temporary directories. - -### Output Files - -* Upon completion of the defined actions, at least one output file must be created in the `/pkg-dist` directory. - -* Output files will be moved to the directory `jellyfin-build/` one directory above the repository root upon completion. diff --git a/deployment/old/centos-package-x64/Dockerfile b/deployment/old/centos-package-x64/Dockerfile deleted file mode 100644 index 08219a2e4a..0000000000 --- a/deployment/old/centos-package-x64/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM centos:7 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/centos-package-x64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist - -# Prepare CentOS environment -RUN yum update -y \ - && yum install -y epel-release - -# Install build dependencies -RUN yum install -y @buildsys-build rpmdevtools yum-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel git - -# Install recent NodeJS and Yarn -RUN curl -fSsLo /etc/yum.repos.d/yarn.repo https://dl.yarnpkg.com/rpm/yarn.repo \ - && rpm -i https://rpm.nodesource.com/pub_10.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm \ - && yum install -y yarn - -# Install DotNET SDK -RUN rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm \ - && rpmdev-setuptree \ - && yum install -y dotnet-sdk-${SDK_VERSION} - -# Create symlinks and directories -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh \ - && mkdir -p ${SOURCE_DIR}/SPECS \ - && ln -s ${PLATFORM_DIR}/pkg-src/jellyfin.spec ${SOURCE_DIR}/SPECS/jellyfin.spec \ - && mkdir -p ${SOURCE_DIR}/SOURCES \ - && ln -s ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/SOURCES - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/centos-package-x64/clean.sh b/deployment/old/centos-package-x64/clean.sh deleted file mode 100755 index 31455de0d4..0000000000 --- a/deployment/old/centos-package-x64/clean.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" -VERSION="$( grep -A1 '^Version:' ${WORKDIR}/pkg-src/jellyfin.spec | awk '{ print $NF }' )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -package_source_dir="${WORKDIR}/pkg-src" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-centos-build" - -rm -f "${package_source_dir}/jellyfin-${VERSION}.tar.gz" &>/dev/null \ - || sudo rm -f "${package_source_dir}/jellyfin-${VERSION}.tar.gz" &>/dev/null - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/centos-package-x64/dependencies.txt b/deployment/old/centos-package-x64/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/centos-package-x64/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/centos-package-x64/docker-build.sh b/deployment/old/centos-package-x64/docker-build.sh deleted file mode 100755 index 62dd144e50..0000000000 --- a/deployment/old/centos-package-x64/docker-build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# Builds the RPM inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Build RPM -make -f .copr/Makefile srpm outdir=/root/rpmbuild/SRPMS -rpmbuild --rebuild -bb /root/rpmbuild/SRPMS/jellyfin-*.src.rpm - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/rpm -mv /root/rpmbuild/RPMS/x86_64/jellyfin-*.rpm /root/rpmbuild/SRPMS/jellyfin-*.src.rpm ${ARTIFACT_DIR}/rpm/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/centos-package-x64/package.sh b/deployment/old/centos-package-x64/package.sh deleted file mode 100755 index 1b983f49d9..0000000000 --- a/deployment/old/centos-package-x64/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-centos-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the RPMs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the RPMs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/rpm/* "${output_dir}" diff --git a/deployment/old/centos-package-x64/pkg-src b/deployment/old/centos-package-x64/pkg-src deleted file mode 120000 index 3ff4d3cbf5..0000000000 --- a/deployment/old/centos-package-x64/pkg-src +++ /dev/null @@ -1 +0,0 @@ -../fedora-package-x64/pkg-src/ \ No newline at end of file diff --git a/deployment/old/debian-package-arm64/Dockerfile.amd64 b/deployment/old/debian-package-arm64/Dockerfile.amd64 deleted file mode 100644 index b63e08b7dd..0000000000 --- a/deployment/old/debian-package-arm64/Dockerfile.amd64 +++ /dev/null @@ -1,43 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-arm64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Prepare the cross-toolchain -RUN dpkg --add-architecture arm64 \ - && apt-get update \ - && apt-get install -y cross-gcc-dev \ - && TARGET_LIST="arm64" cross-gcc-gensource 8 \ - && cd cross-gcc-packages-amd64/cross-gcc-8-arm64 \ - && apt-get install -y gcc-8-source libstdc++-8-dev-arm64-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:arm64 linux-libc-dev:arm64 libgcc1:arm64 libcurl4-openssl-dev:arm64 libfontconfig1-dev:arm64 libfreetype6-dev:arm64 libssl-dev:arm64 liblttng-ust0:arm64 libstdc++-8-dev:arm64 - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] -#ENTRYPOINT ["/bin/bash"] diff --git a/deployment/old/debian-package-arm64/Dockerfile.arm64 b/deployment/old/debian-package-arm64/Dockerfile.arm64 deleted file mode 100644 index 9ca4868441..0000000000 --- a/deployment/old/debian-package-arm64/Dockerfile.arm64 +++ /dev/null @@ -1,34 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-arm64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=arm64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev liblttng-ust0 - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/5a4c8f96-1c73-401c-a6de-8e100403188a/0ce6ab39747e2508366d498f9c0a0669/dotnet-sdk-3.1.100-linux-arm64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/debian-package-arm64/clean.sh b/deployment/old/debian-package-arm64/clean.sh deleted file mode 100755 index e7bfdf8b4b..0000000000 --- a/deployment/old/debian-package-arm64/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-debian_arm64-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/debian-package-arm64/dependencies.txt b/deployment/old/debian-package-arm64/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/debian-package-arm64/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/debian-package-arm64/docker-build.sh b/deployment/old/debian-package-arm64/docker-build.sh deleted file mode 100755 index 67ab6bd74b..0000000000 --- a/deployment/old/debian-package-arm64/docker-build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Builds the DEB inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image -sed -i '/dotnet-sdk-3.1,/d' debian/control - -# Build DEB -export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} -dpkg-buildpackage -us -uc -aarm64 - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/deb -mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/debian-package-arm64/package.sh b/deployment/old/debian-package-arm64/package.sh deleted file mode 100755 index 2091982187..0000000000 --- a/deployment/old/debian-package-arm64/package.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -ARCH="$( arch )" -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-debian_arm64-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Determine which Dockerfile to use -case $ARCH in - 'x86_64') - DOCKERFILE="Dockerfile.amd64" - ;; - 'armv7l') - DOCKERFILE="Dockerfile.arm64" - ;; -esac - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./${DOCKERFILE} -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/debian-package-arm64/pkg-src b/deployment/old/debian-package-arm64/pkg-src deleted file mode 120000 index 4c695fea17..0000000000 --- a/deployment/old/debian-package-arm64/pkg-src +++ /dev/null @@ -1 +0,0 @@ -../debian-package-x64/pkg-src \ No newline at end of file diff --git a/deployment/old/debian-package-armhf/Dockerfile.amd64 b/deployment/old/debian-package-armhf/Dockerfile.amd64 deleted file mode 100644 index 1b64b53148..0000000000 --- a/deployment/old/debian-package-armhf/Dockerfile.amd64 +++ /dev/null @@ -1,42 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-armhf -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Prepare the cross-toolchain -RUN dpkg --add-architecture armhf \ - && apt-get update \ - && apt-get install -y cross-gcc-dev \ - && TARGET_LIST="armhf" cross-gcc-gensource 8 \ - && cd cross-gcc-packages-amd64/cross-gcc-8-armhf \ - && apt-get install -y gcc-8-source libstdc++-8-dev-armhf-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip binutils-arm-linux-gnueabihf libc6-dev:armhf linux-libc-dev:armhf libgcc1:armhf libcurl4-openssl-dev:armhf libfontconfig1-dev:armhf libfreetype6-dev:armhf libssl-dev:armhf liblttng-ust0:armhf libstdc++-8-dev:armhf - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/debian-package-armhf/Dockerfile.armhf b/deployment/old/debian-package-armhf/Dockerfile.armhf deleted file mode 100644 index dd398b5aa5..0000000000 --- a/deployment/old/debian-package-armhf/Dockerfile.armhf +++ /dev/null @@ -1,34 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-armhf -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=armhf - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev liblttng-ust0 - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/67766a96-eb8c-4cd2-bca4-ea63d2cc115c/7bf13840aa2ed88793b7315d5e0d74e6/dotnet-sdk-3.1.100-linux-arm.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/debian-package-armhf/clean.sh b/deployment/old/debian-package-armhf/clean.sh deleted file mode 100755 index 35a3d3e9ad..0000000000 --- a/deployment/old/debian-package-armhf/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-debian_armhf-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/debian-package-armhf/dependencies.txt b/deployment/old/debian-package-armhf/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/debian-package-armhf/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/debian-package-armhf/docker-build.sh b/deployment/old/debian-package-armhf/docker-build.sh deleted file mode 100755 index 1bd7fb2911..0000000000 --- a/deployment/old/debian-package-armhf/docker-build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Builds the DEB inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image -sed -i '/dotnet-sdk-3.1,/d' debian/control - -# Build DEB -export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} -dpkg-buildpackage -us -uc -aarmhf - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/deb -mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/debian-package-armhf/package.sh b/deployment/old/debian-package-armhf/package.sh deleted file mode 100755 index 4a27dd8283..0000000000 --- a/deployment/old/debian-package-armhf/package.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -ARCH="$( arch )" -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-debian_armhf-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Determine which Dockerfile to use -case $ARCH in - 'x86_64') - DOCKERFILE="Dockerfile.amd64" - ;; - 'armv7l') - DOCKERFILE="Dockerfile.armhf" - ;; -esac - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./${DOCKERFILE} -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/debian-package-armhf/pkg-src b/deployment/old/debian-package-armhf/pkg-src deleted file mode 120000 index 0bb6d55249..0000000000 --- a/deployment/old/debian-package-armhf/pkg-src +++ /dev/null @@ -1 +0,0 @@ -../debian-package-x64/pkg-src/ \ No newline at end of file diff --git a/deployment/old/debian-package-x64/Dockerfile b/deployment/old/debian-package-x64/Dockerfile deleted file mode 100644 index e863d1edf9..0000000000 --- a/deployment/old/debian-package-x64/Dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-x64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/debian-package-x64/clean.sh b/deployment/old/debian-package-x64/clean.sh deleted file mode 100755 index 4e507bcb27..0000000000 --- a/deployment/old/debian-package-x64/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-debian-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/debian-package-x64/dependencies.txt b/deployment/old/debian-package-x64/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/debian-package-x64/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/debian-package-x64/docker-build.sh b/deployment/old/debian-package-x64/docker-build.sh deleted file mode 100755 index 962a522ebc..0000000000 --- a/deployment/old/debian-package-x64/docker-build.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# Builds the DEB inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image -sed -i '/dotnet-sdk-3.1,/d' debian/control - -# Build DEB -dpkg-buildpackage -us -uc - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/deb -mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/debian-package-x64/package.sh b/deployment/old/debian-package-x64/package.sh deleted file mode 100755 index 5a416959ab..0000000000 --- a/deployment/old/debian-package-x64/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-debian-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/debian-package-x64/pkg-src/changelog b/deployment/old/debian-package-x64/pkg-src/changelog deleted file mode 100644 index 51c4822370..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/changelog +++ /dev/null @@ -1,59 +0,0 @@ -jellyfin (10.5.0-1) unstable; urgency=medium - - * New upstream version 10.5.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.5.0 - - -- Jellyfin Packaging Team Fri, 11 Oct 2019 20:12:38 -0400 - -jellyfin (10.4.0-1) unstable; urgency=medium - - * New upstream version 10.4.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.4.0 - - -- Jellyfin Packaging Team Sat, 31 Aug 2019 21:38:56 -0400 - -jellyfin (10.3.7-1) unstable; urgency=medium - - * New upstream version 10.3.7; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.7 - - -- Jellyfin Packaging Team Wed, 24 Jul 2019 10:48:28 -0400 - -jellyfin (10.3.6-1) unstable; urgency=medium - - * New upstream version 10.3.6; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.6 - - -- Jellyfin Packaging Team Sat, 06 Jul 2019 13:34:19 -0400 - -jellyfin (10.3.5-1) unstable; urgency=medium - - * New upstream version 10.3.5; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.5 - - -- Jellyfin Packaging Team Sun, 09 Jun 2019 21:47:35 -0400 - -jellyfin (10.3.4-1) unstable; urgency=medium - - * New upstream version 10.3.4; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.4 - - -- Jellyfin Packaging Team Thu, 06 Jun 2019 22:45:31 -0400 - -jellyfin (10.3.3-1) unstable; urgency=medium - - * New upstream version 10.3.3; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.3 - - -- Jellyfin Packaging Team Fri, 17 May 2019 23:12:08 -0400 - -jellyfin (10.3.2-1) unstable; urgency=medium - - * New upstream version 10.3.2; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.2 - - -- Jellyfin Packaging Team Tue, 30 Apr 2019 20:18:44 -0400 - -jellyfin (10.3.1-1) unstable; urgency=medium - - * New upstream version 10.3.1; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.1 - - -- Jellyfin Packaging Team Sat, 20 Apr 2019 14:24:07 -0400 - -jellyfin (10.3.0-1) unstable; urgency=medium - - * New upstream version 10.3.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.0 - - -- Jellyfin Packaging Team Fri, 19 Apr 2019 14:24:29 -0400 diff --git a/deployment/old/debian-package-x64/pkg-src/compat b/deployment/old/debian-package-x64/pkg-src/compat deleted file mode 100644 index 45a4fb75db..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/compat +++ /dev/null @@ -1 +0,0 @@ -8 diff --git a/deployment/old/debian-package-x64/pkg-src/conf/jellyfin b/deployment/old/debian-package-x64/pkg-src/conf/jellyfin deleted file mode 100644 index c6e595f15a..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/conf/jellyfin +++ /dev/null @@ -1,40 +0,0 @@ -# Jellyfin default configuration options -# This is a POSIX shell fragment - -# Use this file to override the default configurations; add additional -# options with JELLYFIN_ADD_OPTS. - -# Under systemd, use -# /etc/systemd/system/jellyfin.service.d/jellyfin.service.conf -# to override the user or this config file's location. - -# -# General options -# - -# Program directories -JELLYFIN_DATA_DIR="/var/lib/jellyfin" -JELLYFIN_CONFIG_DIR="/etc/jellyfin" -JELLYFIN_LOG_DIR="/var/log/jellyfin" -JELLYFIN_CACHE_DIR="/var/cache/jellyfin" - -# Restart script for in-app server control -JELLYFIN_RESTART_OPT="--restartpath=/usr/lib/jellyfin/restart.sh" - -# ffmpeg binary paths, overriding the system values -JELLYFIN_FFMPEG_OPT="--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg" - -# [OPTIONAL] run Jellyfin as a headless service -#JELLYFIN_SERVICE_OPT="--service" - -# [OPTIONAL] run Jellyfin without the web app -#JELLYFIN_NOWEBAPP_OPT="--noautorunwebapp" - -# -# SysV init/Upstart options -# - -# Application username -JELLYFIN_USER="jellyfin" -# Full application command -JELLYFIN_ARGS="$JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLFIN_NOWEBAPP_OPT" diff --git a/deployment/old/debian-package-x64/pkg-src/conf/jellyfin-sudoers b/deployment/old/debian-package-x64/pkg-src/conf/jellyfin-sudoers deleted file mode 100644 index b481ba4ad4..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/conf/jellyfin-sudoers +++ /dev/null @@ -1,37 +0,0 @@ -#Allow jellyfin group to start, stop and restart itself -Cmnd_Alias RESTARTSERVER_SYSV = /sbin/service jellyfin restart, /usr/sbin/service jellyfin restart -Cmnd_Alias STARTSERVER_SYSV = /sbin/service jellyfin start, /usr/sbin/service jellyfin start -Cmnd_Alias STOPSERVER_SYSV = /sbin/service jellyfin stop, /usr/sbin/service jellyfin stop -Cmnd_Alias RESTARTSERVER_SYSTEMD = /usr/bin/systemctl restart jellyfin, /bin/systemctl restart jellyfin -Cmnd_Alias STARTSERVER_SYSTEMD = /usr/bin/systemctl start jellyfin, /bin/systemctl start jellyfin -Cmnd_Alias STOPSERVER_SYSTEMD = /usr/bin/systemctl stop jellyfin, /bin/systemctl stop jellyfin -Cmnd_Alias RESTARTSERVER_INITD = /etc/init.d/jellyfin restart -Cmnd_Alias STARTSERVER_INITD = /etc/init.d/jellyfin start -Cmnd_Alias STOPSERVER_INITD = /etc/init.d/jellyfin stop - - -jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSV -jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSV -jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSV -jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSTEMD -jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSTEMD -jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSTEMD -jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_INITD -jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_INITD -jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_INITD - -Defaults!RESTARTSERVER_SYSV !requiretty -Defaults!STARTSERVER_SYSV !requiretty -Defaults!STOPSERVER_SYSV !requiretty -Defaults!RESTARTSERVER_SYSTEMD !requiretty -Defaults!STARTSERVER_SYSTEMD !requiretty -Defaults!STOPSERVER_SYSTEMD !requiretty -Defaults!RESTARTSERVER_INITD !requiretty -Defaults!STARTSERVER_INITD !requiretty -Defaults!STOPSERVER_INITD !requiretty - -#Allow the server to mount iso images -jellyfin ALL=(ALL) NOPASSWD: /bin/mount -jellyfin ALL=(ALL) NOPASSWD: /bin/umount - -Defaults:jellyfin !requiretty diff --git a/deployment/old/debian-package-x64/pkg-src/conf/jellyfin.service.conf b/deployment/old/debian-package-x64/pkg-src/conf/jellyfin.service.conf deleted file mode 100644 index 1b69dd74ef..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/conf/jellyfin.service.conf +++ /dev/null @@ -1,7 +0,0 @@ -# Jellyfin systemd configuration options - -# Use this file to override the user or environment file location. - -[Service] -#User = jellyfin -#EnvironmentFile = /etc/default/jellyfin diff --git a/deployment/old/debian-package-x64/pkg-src/conf/logging.json b/deployment/old/debian-package-x64/pkg-src/conf/logging.json deleted file mode 100644 index f32b2089eb..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/conf/logging.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "Serilog": { - "MinimumLevel": "Information", - "WriteTo": [ - { - "Name": "Console", - "Args": { - "outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}" - } - }, - { - "Name": "Async", - "Args": { - "configure": [ - { - "Name": "File", - "Args": { - "path": "%JELLYFIN_LOG_DIR%//jellyfin.log", - "fileSizeLimitBytes": 10485700, - "rollOnFileSizeLimit": true, - "retainedFileCountLimit": 10, - "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}" - } - } - ] - } - } - ] - } -} diff --git a/deployment/old/debian-package-x64/pkg-src/control b/deployment/old/debian-package-x64/pkg-src/control deleted file mode 100644 index 13fd3ecabb..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/control +++ /dev/null @@ -1,31 +0,0 @@ -Source: jellyfin -Section: misc -Priority: optional -Maintainer: Jellyfin Team -Build-Depends: debhelper (>= 9), - dotnet-sdk-3.1, - libc6-dev, - libcurl4-openssl-dev, - libfontconfig1-dev, - libfreetype6-dev, - libssl-dev, - wget, - npm | nodejs -Standards-Version: 3.9.4 -Homepage: https://jellyfin.media/ -Vcs-Git: https://github.org/jellyfin/jellyfin.git -Vcs-Browser: https://github.org/jellyfin/jellyfin - -Package: jellyfin -Replaces: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server -Breaks: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server -Conflicts: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server -Architecture: any -Depends: at, - libsqlite3-0, - jellyfin-ffmpeg, - libfontconfig1, - libfreetype6, - libssl1.1 -Description: Jellyfin is a home media server. - It is built on top of other popular open source technologies such as Service Stack, jQuery, jQuery mobile, and Mono. It features a REST-based api with built-in documentation to facilitate client development. We also have client libraries for our api to enable rapid development. diff --git a/deployment/old/debian-package-x64/pkg-src/copyright b/deployment/old/debian-package-x64/pkg-src/copyright deleted file mode 100644 index 0d7a2a6007..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/copyright +++ /dev/null @@ -1,29 +0,0 @@ -Format: http://dep.debian.net/deps/dep5 -Upstream-Name: jellyfin -Source: https://github.com/jellyfin/jellyfin - -Files: * -Copyright: 2018 Jellyfin Team -License: GPL-2.0+ - -Files: debian/* -Copyright: 2018 Joshua Boniface -Copyright: 2014 Carlos Hernandez -License: GPL-2.0+ - -License: GPL-2.0+ - This package is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - . - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see - . - On Debian systems, the complete text of the GNU General - Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/deployment/old/debian-package-x64/pkg-src/gbp.conf b/deployment/old/debian-package-x64/pkg-src/gbp.conf deleted file mode 100644 index 60b3d28723..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/gbp.conf +++ /dev/null @@ -1,6 +0,0 @@ -[DEFAULT] -pristine-tar = False -cleaner = fakeroot debian/rules clean - -[import-orig] -filter = [ ".git*", ".hg*", ".vs*", ".vscode*" ] diff --git a/deployment/old/debian-package-x64/pkg-src/install b/deployment/old/debian-package-x64/pkg-src/install deleted file mode 100644 index 994322d141..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/install +++ /dev/null @@ -1,6 +0,0 @@ -usr/lib/jellyfin usr/lib/ -debian/conf/jellyfin etc/default/ -debian/conf/logging.json etc/jellyfin/ -debian/conf/jellyfin.service.conf etc/systemd/system/jellyfin.service.d/ -debian/conf/jellyfin-sudoers etc/sudoers.d/ -debian/bin/restart.sh usr/lib/jellyfin/ diff --git a/deployment/old/debian-package-x64/pkg-src/jellyfin.init b/deployment/old/debian-package-x64/pkg-src/jellyfin.init deleted file mode 100644 index 7f5642bac1..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/jellyfin.init +++ /dev/null @@ -1,61 +0,0 @@ -### BEGIN INIT INFO -# Provides: Jellyfin Media Server -# Required-Start: $local_fs $network -# Required-Stop: $local_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Jellyfin Media Server -# Description: Runs Jellyfin Server -### END INIT INFO - -set -e - -# Carry out specific functions when asked to by the system - -if test -f /etc/default/jellyfin; then - . /etc/default/jellyfin -fi - -. /lib/lsb/init-functions - -PIDFILE="/run/jellyfin.pid" - -case "$1" in - start) - log_daemon_msg "Starting Jellyfin Media Server" "jellyfin" || true - - if start-stop-daemon --start --quiet --oknodo --background --pidfile $PIDFILE --make-pidfile --user $JELLYFIN_USER --chuid $JELLYFIN_USER --exec /usr/bin/jellyfin -- $JELLYFIN_ARGS; then - log_end_msg 0 || true - else - log_end_msg 1 || true - fi - ;; - - stop) - log_daemon_msg "Stopping Jellyfin Media Server" "jellyfin" || true - if start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --remove-pidfile; then - log_end_msg 0 || true - else - log_end_msg 1 || true - fi - ;; - - restart) - log_daemon_msg "Restarting Jellyfin Media Server" "jellyfin" || true - start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PIDFILE --remove-pidfile - if start-stop-daemon --start --quiet --oknodo --background --pidfile $PIDFILE --make-pidfile --user $JELLYFIN_USER --chuid $JELLYFIN_USER --exec /usr/bin/jellyfin -- $JELLYFIN_ARGS; then - log_end_msg 0 || true - else - log_end_msg 1 || true - fi - ;; - - status) - status_of_proc -p $PIDFILE /usr/bin/jellyfin jellyfin && exit 0 || exit $? - ;; - - *) - echo "Usage: $0 {start|stop|restart|status}" - exit 1 - ;; -esac diff --git a/deployment/old/debian-package-x64/pkg-src/jellyfin.service b/deployment/old/debian-package-x64/pkg-src/jellyfin.service deleted file mode 100644 index 1305e238b0..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/jellyfin.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description = Jellyfin Media Server -After = network.target - -[Service] -Type = simple -EnvironmentFile = /etc/default/jellyfin -User = jellyfin -ExecStart = /usr/bin/jellyfin ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT} -Restart = on-failure -TimeoutSec = 15 - -[Install] -WantedBy = multi-user.target diff --git a/deployment/old/debian-package-x64/pkg-src/jellyfin.upstart b/deployment/old/debian-package-x64/pkg-src/jellyfin.upstart deleted file mode 100644 index ef5bc9bcaf..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/jellyfin.upstart +++ /dev/null @@ -1,20 +0,0 @@ -description "jellyfin daemon" - -start on (local-filesystems and net-device-up IFACE!=lo) -stop on runlevel [!2345] - -console log -respawn -respawn limit 10 5 - -kill timeout 20 - -script - set -x - echo "Starting $UPSTART_JOB" - - # Log file - logger -t "$0" "DEBUG: `set`" - . /etc/default/jellyfin - exec su -u $JELLYFIN_USER -c /usr/bin/jellyfin $JELLYFIN_ARGS -end script diff --git a/deployment/old/debian-package-x64/pkg-src/po/POTFILES.in b/deployment/old/debian-package-x64/pkg-src/po/POTFILES.in deleted file mode 100644 index cef83a3407..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/po/POTFILES.in +++ /dev/null @@ -1 +0,0 @@ -[type: gettext/rfc822deb] templates diff --git a/deployment/old/debian-package-x64/pkg-src/po/templates.pot b/deployment/old/debian-package-x64/pkg-src/po/templates.pot deleted file mode 100644 index 2cdcae4173..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/po/templates.pot +++ /dev/null @@ -1,57 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: jellyfin-server\n" -"Report-Msgid-Bugs-To: jellyfin-server@packages.debian.org\n" -"POT-Creation-Date: 2015-06-12 20:51-0600\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Type: note -#. Description -#: ../templates:1001 -msgid "Jellyfin permission info:" -msgstr "" - -#. Type: note -#. Description -#: ../templates:1001 -msgid "" -"Jellyfin by default runs under a user named \"jellyfin\". Please ensure that the " -"user jellyfin has read and write access to any folders you wish to add to your " -"library. Otherwise please run jellyfin under a different user." -msgstr "" - -#. Type: string -#. Description -#: ../templates:2001 -msgid "Username to run Jellyfin as:" -msgstr "" - -#. Type: string -#. Description -#: ../templates:2001 -msgid "The user that jellyfin will run as." -msgstr "" - -#. Type: note -#. Description -#: ../templates:3001 -msgid "Jellyfin still running" -msgstr "" - -#. Type: note -#. Description -#: ../templates:3001 -msgid "Jellyfin is currently running. Please close it and try again." -msgstr "" diff --git a/deployment/old/debian-package-x64/pkg-src/postinst b/deployment/old/debian-package-x64/pkg-src/postinst deleted file mode 100644 index 860222e051..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/postinst +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash -set -e - -NAME=jellyfin -DEFAULT_FILE=/etc/default/${NAME} - -# Source Jellyfin default configuration -if [[ -f $DEFAULT_FILE ]]; then - . $DEFAULT_FILE -fi - -# Data directories for program data (cache, db), configs, and logs -PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} -CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} -LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} -CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} - -case "$1" in - configure) - # create jellyfin group if it does not exist - if [[ -z "$(getent group jellyfin)" ]]; then - addgroup --quiet --system jellyfin > /dev/null 2>&1 - fi - # create jellyfin user if it does not exist - if [[ -z "$(getent passwd jellyfin)" ]]; then - adduser --system --ingroup jellyfin --shell /bin/false jellyfin --no-create-home --home ${PROGRAMDATA} \ - --gecos "Jellyfin default user" > /dev/null 2>&1 - fi - # ensure $PROGRAMDATA exists - if [[ ! -d $PROGRAMDATA ]]; then - mkdir $PROGRAMDATA - fi - # ensure $CONFIGDATA exists - if [[ ! -d $CONFIGDATA ]]; then - mkdir $CONFIGDATA - fi - # ensure $LOGDATA exists - if [[ ! -d $LOGDATA ]]; then - mkdir $LOGDATA - fi - # ensure $CACHEDATA exists - if [[ ! -d $CACHEDATA ]]; then - mkdir $CACHEDATA - fi - # Ensure permissions are correct on all config directories - chown -R jellyfin $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA - chgrp adm $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA - chmod 0750 $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA - - chmod +x /usr/lib/jellyfin/restart.sh > /dev/null 2>&1 || true - - # Install jellyfin symlink into /usr/bin - ln -sf /usr/lib/jellyfin/bin/jellyfin /usr/bin/jellyfin - - ;; - abort-upgrade|abort-remove|abort-deconfigure) - ;; - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER - -if [[ -x "/usr/bin/deb-systemd-helper" ]]; then - # Manual init script handling - deb-systemd-helper unmask jellyfin.service >/dev/null || true - # was-enabled defaults to true, so new installations run enable. - if deb-systemd-helper --quiet was-enabled jellyfin.service; then - # Enables the unit on first installation, creates new - # symlinks on upgrades if the unit file has changed. - deb-systemd-helper enable jellyfin.service >/dev/null || true - else - # Update the statefile to add new symlinks (if any), which need to be - # cleaned up on purge. Also remove old symlinks. - deb-systemd-helper update-state jellyfin.service >/dev/null || true - fi -fi - -# End automatically added section -# Automatically added by dh_installinit -if [[ "$1" == "configure" ]] || [[ "$1" == "abort-upgrade" ]]; then - if [[ -d "/run/systemd/systemd" ]]; then - systemctl --system daemon-reload >/dev/null || true - deb-systemd-invoke start jellyfin >/dev/null || true - elif [[ -x "/etc/init.d/jellyfin" ]] || [[ -e "/etc/init/jellyfin.conf" ]]; then - update-rc.d jellyfin defaults >/dev/null - invoke-rc.d jellyfin start || exit $? - fi -fi -exit 0 diff --git a/deployment/old/debian-package-x64/pkg-src/postrm b/deployment/old/debian-package-x64/pkg-src/postrm deleted file mode 100644 index 1d00a984ec..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/postrm +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -set -e - -NAME=jellyfin -DEFAULT_FILE=/etc/default/${NAME} - -# Source Jellyfin default configuration -if [[ -f $DEFAULT_FILE ]]; then - . $DEFAULT_FILE -fi - -# Data directories for program data (cache, db), configs, and logs -PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} -CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} -LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} -CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} - -# In case this system is running systemd, we make systemd reload the unit files -# to pick up changes. -if [[ -d /run/systemd/system ]] ; then - systemctl --system daemon-reload >/dev/null || true -fi - -case "$1" in - purge) - echo PURGE | debconf-communicate $NAME > /dev/null 2>&1 || true - - if [[ -x "/etc/init.d/jellyfin" ]] || [[ -e "/etc/init/jellyfin.connf" ]]; then - update-rc.d jellyfin remove >/dev/null 2>&1 || true - fi - - if [[ -x "/usr/bin/deb-systemd-helper" ]]; then - deb-systemd-helper purge jellyfin.service >/dev/null - deb-systemd-helper unmask jellyfin.service >/dev/null - fi - - # Remove user and group - userdel jellyfin > /dev/null 2>&1 || true - delgroup --quiet jellyfin > /dev/null 2>&1 || true - # Remove config dir - if [[ -d $CONFIGDATA ]]; then - rm -rf $CONFIGDATA - fi - # Remove log dir - if [[ -d $LOGDATA ]]; then - rm -rf $LOGDATA - fi - # Remove cache dir - if [[ -d $CACHEDATA ]]; then - rm -rf $CACHEDATA - fi - # Remove program data dir - if [[ -d $PROGRAMDATA ]]; then - rm -rf $PROGRAMDATA - fi - # Remove binary symlink - [[ -f /usr/bin/jellyfin ]] && rm /usr/bin/jellyfin - # Remove sudoers config - [[ -f /etc/sudoers.d/jellyfin-sudoers ]] && rm /etc/sudoers.d/jellyfin-sudoers - # Remove anything at the default locations; catches situations where the user moved the defaults - [[ -e /etc/jellyfin ]] && rm -rf /etc/jellyfin - [[ -e /var/log/jellyfin ]] && rm -rf /var/log/jellyfin - [[ -e /var/cache/jellyfin ]] && rm -rf /var/cache/jellyfin - [[ -e /var/lib/jellyfin ]] && rm -rf /var/lib/jellyfin - ;; - remove) - if [[ -x "/usr/bin/deb-systemd-helper" ]]; then - deb-systemd-helper mask jellyfin.service >/dev/null - fi - ;; - upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - ;; - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/deployment/old/debian-package-x64/pkg-src/preinst b/deployment/old/debian-package-x64/pkg-src/preinst deleted file mode 100644 index 2713fb9b80..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/preinst +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash -set -e - -NAME=jellyfin -DEFAULT_FILE=/etc/default/${NAME} - -# Source Jellyfin default configuration -if [[ -f $DEFAULT_FILE ]]; then - . $DEFAULT_FILE -fi - -# Data directories for program data (cache, db), configs, and logs -PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} -CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} -LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} -CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} - -# In case this system is running systemd, we make systemd reload the unit files -# to pick up changes. -if [[ -d /run/systemd/system ]] ; then - systemctl --system daemon-reload >/dev/null || true -fi - -case "$1" in - install|upgrade) - # try graceful termination; - if [[ -d /run/systemd/system ]]; then - deb-systemd-invoke stop ${NAME}.service > /dev/null 2>&1 || true - elif [ -x "/etc/init.d/${NAME}" ] || [ -e "/etc/init/${NAME}.conf" ]; then - invoke-rc.d ${NAME} stop > /dev/null 2>&1 || true - fi - # try and figure out if jellyfin is running - PIDFILE=$(find /var/run/ -maxdepth 1 -mindepth 1 -name "jellyfin*.pid" -print -quit) - [[ -n "$PIDFILE" ]] && [[ -s "$PIDFILE" ]] && JELLYFIN_PID=$(cat ${PIDFILE}) - # if its running, let's stop it - if [[ -n "$JELLYFIN_PID" ]]; then - echo "Stopping Jellyfin!" - # if jellyfin is still running, kill it - if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then - CPIDS=$(pgrep -P $JELLYFIN_PID) - sleep 2 && kill -KILL $CPIDS - kill -TERM $CPIDS > /dev/null 2>&1 - fi - sleep 1 - # if it's still running, show error - if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then - echo "Could not successfully stop JellyfinServer, please do so before uninstalling." - exit 1 - else - [[ -f $PIDFILE ]] && rm $PIDFILE - fi - fi - - # Clean up old Emby cruft that can break the user's system - [[ -f /etc/sudoers.d/emby ]] && rm -f /etc/sudoers.d/emby - - # If we have existing config, log, or cache dirs in /var/lib/jellyfin, move them into the right place - if [[ -d $PROGRAMDATA/config ]]; then - mv $PROGRAMDATA/config $CONFIGDATA - fi - if [[ -d $PROGRAMDATA/logs ]]; then - mv $PROGRAMDATA/logs $LOGDATA - fi - if [[ -d $PROGRAMDATA/logs ]]; then - mv $PROGRAMDATA/cache $CACHEDATA - fi - - ;; - abort-upgrade) - ;; - *) - echo "preinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac -#DEBHELPER# - -exit 0 diff --git a/deployment/old/debian-package-x64/pkg-src/prerm b/deployment/old/debian-package-x64/pkg-src/prerm deleted file mode 100644 index e965cb7d71..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/prerm +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -set -e - -NAME=jellyfin -DEFAULT_FILE=/etc/default/${NAME} - -# Source Jellyfin default configuration -if [[ -f $DEFAULT_FILE ]]; then - . $DEFAULT_FILE -fi - -# Data directories for program data (cache, db), configs, and logs -PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} -CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} -LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} -CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} - -case "$1" in - remove|upgrade|deconfigure) - echo "Stopping Jellyfin!" - # try graceful termination; - if [[ -d /run/systemd/system ]]; then - deb-systemd-invoke stop ${NAME}.service > /dev/null 2>&1 || true - elif [ -x "/etc/init.d/${NAME}" ] || [ -e "/etc/init/${NAME}.conf" ]; then - invoke-rc.d ${NAME} stop > /dev/null 2>&1 || true - fi - # Ensure that it is shutdown - PIDFILE=$(find /var/run/ -maxdepth 1 -mindepth 1 -name "jellyfin*.pid" -print -quit) - [[ -n "$PIDFILE" ]] && [[ -s "$PIDFILE" ]] && JELLYFIN_PID=$(cat ${PIDFILE}) - # if its running, let's stop it - if [[ -n "$JELLYFIN_PID" ]]; then - # if jellyfin is still running, kill it - if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then - CPIDS=$(pgrep -P $JELLYFIN_PID) - sleep 2 && kill -KILL $CPIDS - kill -TERM $CPIDS > /dev/null 2>&1 - fi - sleep 1 - # if it's still running, show error - if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then - echo "Could not successfully stop Jellyfin, please do so before uninstalling." - exit 1 - else - [[ -f $PIDFILE ]] && rm $PIDFILE - fi - fi - if [[ -f /usr/lib/jellyfin/bin/MediaBrowser.Server.Mono.exe.so ]]; then - rm /usr/lib/jellyfin/bin/MediaBrowser.Server.Mono.exe.so - fi - ;; - failed-upgrade) - ;; - *) - echo "prerm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/deployment/old/debian-package-x64/pkg-src/rules b/deployment/old/debian-package-x64/pkg-src/rules deleted file mode 100755 index c2d57dfb22..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/rules +++ /dev/null @@ -1,66 +0,0 @@ -#! /usr/bin/make -f -CONFIG := Release -TERM := xterm -SHELL := /bin/bash -WEB_TARGET := $(CURDIR)/MediaBrowser.WebDashboard/jellyfin-web -WEB_VERSION := $(shell sed -n -e 's/^version: "\(.*\)"/\1/p' $(CURDIR)/build.yaml) - -HOST_ARCH := $(shell arch) -BUILD_ARCH := ${DEB_HOST_MULTIARCH} -ifeq ($(HOST_ARCH),x86_64) - # Building AMD64 - DOTNETRUNTIME := debian-x64 - ifeq ($(BUILD_ARCH),arm-linux-gnueabihf) - # Cross-building ARM on AMD64 - DOTNETRUNTIME := debian-arm - endif - ifeq ($(BUILD_ARCH),aarch64-linux-gnu) - # Cross-building ARM on AMD64 - DOTNETRUNTIME := debian-arm64 - endif -endif -ifeq ($(HOST_ARCH),armv7l) - # Building ARM - DOTNETRUNTIME := debian-arm -endif -ifeq ($(HOST_ARCH),arm64) - # Building ARM - DOTNETRUNTIME := debian-arm64 -endif - -export DH_VERBOSE=1 -export DOTNET_CLI_TELEMETRY_OPTOUT=1 - -%: - dh $@ - -# disable "make check" -override_dh_auto_test: - -# disable stripping debugging symbols -override_dh_clistrip: - -override_dh_auto_build: - echo $(WEB_VERSION) - # Clone down and build Web frontend - mkdir -p $(WEB_TARGET) - wget -O web-src.tgz https://github.com/jellyfin/jellyfin-web/archive/v$(WEB_VERSION).tar.gz || wget -O web-src.tgz https://github.com/jellyfin/jellyfin-web/archive/master.tar.gz - mkdir -p $(CURDIR)/web - tar -xzf web-src.tgz -C $(CURDIR)/web/ --strip 1 - cd $(CURDIR)/web/ && npm install yarn - cd $(CURDIR)/web/ && node_modules/yarn/bin/yarn install - mv $(CURDIR)/web/dist/* $(WEB_TARGET)/ - # Build the application - dotnet publish --configuration $(CONFIG) --output='$(CURDIR)/usr/lib/jellyfin/bin' --self-contained --runtime $(DOTNETRUNTIME) \ - "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" Jellyfin.Server - -override_dh_auto_clean: - dotnet clean -maxcpucount:1 --configuration $(CONFIG) Jellyfin.Server || true - rm -f '$(CURDIR)/web-src.tgz' - rm -rf '$(CURDIR)/usr' - rm -rf '$(CURDIR)/web' - rm -rf '$(WEB_TARGET)' - -# Force the service name to jellyfin even if we're building jellyfin-nightly -override_dh_installinit: - dh_installinit --name=jellyfin diff --git a/deployment/old/debian-package-x64/pkg-src/source.lintian-overrides b/deployment/old/debian-package-x64/pkg-src/source.lintian-overrides deleted file mode 100644 index aeb332f13a..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/source.lintian-overrides +++ /dev/null @@ -1,3 +0,0 @@ -# This is an override for the following lintian errors: -jellyfin source: license-problem-md5sum-non-free-file Emby.Drawing/ImageMagick/fonts/webdings.ttf* -jellyfin source: source-is-missing diff --git a/deployment/old/debian-package-x64/pkg-src/source/format b/deployment/old/debian-package-x64/pkg-src/source/format deleted file mode 100644 index d3827e75a5..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/source/format +++ /dev/null @@ -1 +0,0 @@ -1.0 diff --git a/deployment/old/debian-package-x64/pkg-src/source/options b/deployment/old/debian-package-x64/pkg-src/source/options deleted file mode 100644 index 17b5373d5e..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/source/options +++ /dev/null @@ -1,11 +0,0 @@ -tar-ignore='.git*' -tar-ignore='**/.git' -tar-ignore='**/.hg' -tar-ignore='**/.vs' -tar-ignore='**/.vscode' -tar-ignore='deployment' -tar-ignore='**/bin' -tar-ignore='**/obj' -tar-ignore='**/.nuget' -tar-ignore='*.deb' -tar-ignore='ThirdParty' diff --git a/deployment/old/fedora-package-x64/Dockerfile b/deployment/old/fedora-package-x64/Dockerfile deleted file mode 100644 index 87120f3a05..0000000000 --- a/deployment/old/fedora-package-x64/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM fedora:31 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/fedora-package-x64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist - -# Prepare Fedora environment -RUN dnf update -y - -# Install build dependencies -RUN dnf install -y @buildsys-build rpmdevtools git dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel nodejs-yarn - -# Install DotNET SDK -RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \ - && curl -o /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/$(rpm -E %fedora)/prod.repo \ - && dnf install -y dotnet-sdk-${SDK_VERSION} dotnet-runtime-${SDK_VERSION} - -# Create symlinks and directories -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh \ - && mkdir -p ${SOURCE_DIR}/SPECS \ - && ln -s ${PLATFORM_DIR}/pkg-src/jellyfin.spec ${SOURCE_DIR}/SPECS/jellyfin.spec \ - && mkdir -p ${SOURCE_DIR}/SOURCES \ - && ln -s ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/SOURCES - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/fedora-package-x64/clean.sh b/deployment/old/fedora-package-x64/clean.sh deleted file mode 100755 index 700c8f1bb3..0000000000 --- a/deployment/old/fedora-package-x64/clean.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" -VERSION="$( grep -A1 '^Version:' ${WORKDIR}/pkg-src/jellyfin.spec | awk '{ print $NF }' )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -package_source_dir="${WORKDIR}/pkg-src" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-fedora-build" - -rm -f "${package_source_dir}/jellyfin-${VERSION}.tar.gz" &>/dev/null \ - || sudo rm -f "${package_source_dir}/jellyfin-${VERSION}.tar.gz" &>/dev/null - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/fedora-package-x64/dependencies.txt b/deployment/old/fedora-package-x64/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/fedora-package-x64/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/fedora-package-x64/docker-build.sh b/deployment/old/fedora-package-x64/docker-build.sh deleted file mode 100755 index 740e8d35ca..0000000000 --- a/deployment/old/fedora-package-x64/docker-build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# Builds the RPM inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Build RPM -make -f .copr/Makefile srpm outdir=/root/rpmbuild/SRPMS -rpmbuild -rb /root/rpmbuild/SRPMS/jellyfin-*.src.rpm - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/rpm -mv /root/rpmbuild/RPMS/x86_64/jellyfin-*.rpm /root/rpmbuild/SRPMS/jellyfin-*.src.rpm ${ARTIFACT_DIR}/rpm/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/fedora-package-x64/package.sh b/deployment/old/fedora-package-x64/package.sh deleted file mode 100755 index ae6962dd1f..0000000000 --- a/deployment/old/fedora-package-x64/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-fedora-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the RPMs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the RPMs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/rpm/* "${output_dir}" diff --git a/deployment/old/fedora-package-x64/pkg-src/.gitignore b/deployment/old/fedora-package-x64/pkg-src/.gitignore deleted file mode 100644 index 6019b98c22..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.rpm -*.zip -*.tar.gz \ No newline at end of file diff --git a/deployment/old/fedora-package-x64/pkg-src/README.md b/deployment/old/fedora-package-x64/pkg-src/README.md deleted file mode 100644 index 7ed6f7efc6..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Jellyfin RPM - -## Build Fedora Package with docker - -Change into this directory `cd rpm-package` -Run the build script `./build-fedora-rpm.sh`. -Resulting RPM and src.rpm will be in `../../jellyfin-*.rpm` - -## ffmpeg - -The RPM package for Fedora/CentOS requires some additional repositories as ffmpeg is not in the main repositories. - -```shell -# ffmpeg from RPMfusion free -# Fedora -$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm -# CentOS 7 -$ sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm -``` - -## ISO mounting - -To allow Jellyfin to mount/umount ISO files uncomment these two lines in `/etc/sudoers.d/jellyfin-sudoers` -``` -# %jellyfin ALL=(ALL) NOPASSWD: /bin/mount -# %jellyfin ALL=(ALL) NOPASSWD: /bin/umount -``` - -## Building with dotnet - -Jellyfin is build with `--self-contained` so no dotnet required for runtime. - -```shell -# dotnet required for building the RPM -# Fedora -$ sudo dnf copr enable @dotnet-sig/dotnet -# CentOS -$ sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm -``` - -## TODO - -- [ ] OpenSUSE \ No newline at end of file diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin-firewalld.xml b/deployment/old/fedora-package-x64/pkg-src/jellyfin-firewalld.xml deleted file mode 100644 index 538c5d65f8..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/jellyfin-firewalld.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - Jellyfin - The Free Software Media System. - - - - - diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin.env b/deployment/old/fedora-package-x64/pkg-src/jellyfin.env deleted file mode 100644 index de48f13af5..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/jellyfin.env +++ /dev/null @@ -1,34 +0,0 @@ -# Jellyfin default configuration options - -# Use this file to override the default configurations; add additional -# options with JELLYFIN_ADD_OPTS. - -# To override the user or this config file's location, use -# /etc/systemd/system/jellyfin.service.d/override.conf - -# -# This is a POSIX shell fragment -# - -# -# General options -# - -# Program directories -JELLYFIN_DATA_DIR="/var/lib/jellyfin" -JELLYFIN_CONFIG_DIR="/etc/jellyfin" -JELLYFIN_LOG_DIR="/var/log/jellyfin" -JELLYFIN_CACHE_DIR="/var/cache/jellyfin" - -# In-App service control -JELLYFIN_RESTART_OPT="--restartpath=/usr/libexec/jellyfin/restart.sh" - -# [OPTIONAL] ffmpeg binary paths, overriding the UI-configured values -#JELLYFIN_FFMPEG_OPT="--ffmpeg=/usr/bin/ffmpeg" - -# [OPTIONAL] run Jellyfin as a headless service -#JELLYFIN_SERVICE_OPT="--service" - -# [OPTIONAL] run Jellyfin without the web app -#JELLYFIN_NOWEBAPP_OPT="--noautorunwebapp" - diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin.override.conf b/deployment/old/fedora-package-x64/pkg-src/jellyfin.override.conf deleted file mode 100644 index 8652450bb4..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/jellyfin.override.conf +++ /dev/null @@ -1,7 +0,0 @@ -# Jellyfin systemd configuration options - -# Use this file to override the user or environment file location. - -[Service] -#User = jellyfin -#EnvironmentFile = /etc/sysconfig/jellyfin diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin.service b/deployment/old/fedora-package-x64/pkg-src/jellyfin.service deleted file mode 100644 index f3dc594b1c..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/jellyfin.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -After=network.target -Description=Jellyfin is a free software media system that puts you in control of managing and streaming your media. - -[Service] -EnvironmentFile=/etc/sysconfig/jellyfin -WorkingDirectory=/var/lib/jellyfin -ExecStart=/usr/bin/jellyfin ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT} -TimeoutSec=15 -Restart=on-failure -User=jellyfin -Group=jellyfin - -[Install] -WantedBy=multi-user.target diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin.spec b/deployment/old/fedora-package-x64/pkg-src/jellyfin.spec deleted file mode 100644 index 33c6f6f648..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/jellyfin.spec +++ /dev/null @@ -1,181 +0,0 @@ -%global debug_package %{nil} -# Set the dotnet runtime -%if 0%{?fedora} -%global dotnet_runtime fedora-x64 -%else -%global dotnet_runtime centos-x64 -%endif - -Name: jellyfin -Version: 10.5.0 -Release: 1%{?dist} -Summary: The Free Software Media Browser -License: GPLv2 -URL: https://jellyfin.media -# Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%{version}.tar.gz` -Source0: https://github.com/%{name}/%{name}/archive/%{name}-%{version}.tar.gz -# Jellyfin Webinterface downloaded by `make -f .copr/Makefile srpm`, real URL ends with `v%{version}.tar.gz` -Source1: https://github.com/%{name}/%{name}-web/archive/%{name}-web-%{version}.tar.gz -Source11: jellyfin.service -Source12: jellyfin.env -Source13: jellyfin.sudoers -Source14: restart.sh -Source15: jellyfin.override.conf -Source16: jellyfin-firewalld.xml - -%{?systemd_requires} -BuildRequires: systemd -Requires(pre): shadow-utils -BuildRequires: libcurl-devel, fontconfig-devel, freetype-devel, openssl-devel, glibc-devel, libicu-devel, git -%if 0%{?fedora} -BuildRequires: nodejs-yarn, git -%else -# Requirements not packaged in main repos -# From https://rpm.nodesource.com/pub_10.x/el/7/x86_64/ -BuildRequires: nodejs >= 10 yarn -%endif -Requires: libcurl, fontconfig, freetype, openssl, glibc libicu -# Requirements not packaged in main repos -# COPR @dotnet-sig/dotnet or -# https://packages.microsoft.com/rhel/7/prod/ -BuildRequires: dotnet-runtime-3.1, dotnet-sdk-3.1 -# RPMfusion free -Requires: ffmpeg - -# Disable Automatic Dependency Processing -AutoReqProv: no - -%description -Jellyfin is a free software media system that puts you in control of managing and streaming your media. - - -%prep -%autosetup -n %{name}-%{version} -b 0 -b 1 -web_build_dir="$(mktemp -d)" -web_target="$PWD/MediaBrowser.WebDashboard/jellyfin-web" -pushd ../jellyfin-web-%{version} || pushd ../jellyfin-web-master -%if 0%{?fedora} -nodejs-yarn install -%else -yarn install -%endif -mkdir -p ${web_target} -mv dist/* ${web_target}/ -popd - -%build - -%install -export DOTNET_CLI_TELEMETRY_OPTOUT=1 -export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime %{dotnet_runtime} \ - "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" Jellyfin.Server -%{__install} -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/%{name}/LICENSE -%{__install} -D -m 0644 %{SOURCE15} %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/override.conf -%{__install} -D -m 0644 Jellyfin.Server/Resources/Configuration/logging.json %{buildroot}%{_sysconfdir}/%{name}/logging.json -%{__mkdir} -p %{buildroot}%{_bindir} -tee %{buildroot}%{_bindir}/jellyfin << EOF -#!/bin/sh -exec %{_libdir}/%{name}/%{name} \${@} -EOF -%{__mkdir} -p %{buildroot}%{_sharedstatedir}/jellyfin -%{__mkdir} -p %{buildroot}%{_sysconfdir}/%{name} -%{__mkdir} -p %{buildroot}%{_var}/log/jellyfin -%{__mkdir} -p %{buildroot}%{_var}/cache/jellyfin - -%{__install} -D -m 0644 %{SOURCE11} %{buildroot}%{_unitdir}/%{name}.service -%{__install} -D -m 0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/sysconfig/%{name} -%{__install} -D -m 0600 %{SOURCE13} %{buildroot}%{_sysconfdir}/sudoers.d/%{name}-sudoers -%{__install} -D -m 0755 %{SOURCE14} %{buildroot}%{_libexecdir}/%{name}/restart.sh -%{__install} -D -m 0644 %{SOURCE16} %{buildroot}%{_prefix}/lib/firewalld/services/%{name}.xml - -%files -%{_libdir}/%{name}/jellyfin-web/* -%attr(755,root,root) %{_bindir}/%{name} -%{_libdir}/%{name}/*.json -%{_libdir}/%{name}/*.dll -%{_libdir}/%{name}/*.so -%{_libdir}/%{name}/*.a -%{_libdir}/%{name}/createdump -# Needs 755 else only root can run it since binary build by dotnet is 722 -%attr(755,root,root) %{_libdir}/%{name}/jellyfin -%{_libdir}/%{name}/SOS_README.md -%{_unitdir}/%{name}.service -%{_libexecdir}/%{name}/restart.sh -%{_prefix}/lib/firewalld/services/%{name}.xml -%attr(755,jellyfin,jellyfin) %dir %{_sysconfdir}/%{name} -%config %{_sysconfdir}/sysconfig/%{name} -%config(noreplace) %attr(600,root,root) %{_sysconfdir}/sudoers.d/%{name}-sudoers -%config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/override.conf -%config(noreplace) %attr(644,jellyfin,jellyfin) %{_sysconfdir}/%{name}/logging.json -%attr(750,jellyfin,jellyfin) %dir %{_sharedstatedir}/jellyfin -%attr(-,jellyfin,jellyfin) %dir %{_var}/log/jellyfin -%attr(750,jellyfin,jellyfin) %dir %{_var}/cache/jellyfin -%if 0%{?fedora} -%license LICENSE -%else -%{_datadir}/licenses/%{name}/LICENSE -%endif - -%pre -getent group jellyfin >/dev/null || groupadd -r jellyfin -getent passwd jellyfin >/dev/null || \ - useradd -r -g jellyfin -d %{_sharedstatedir}/jellyfin -s /sbin/nologin \ - -c "Jellyfin default user" jellyfin -exit 0 - -%post -# Move existing configuration cache and logs to their new locations and symlink them. -if [ $1 -gt 1 ] ; then - service_state=$(systemctl is-active jellyfin.service) - if [ "${service_state}" = "active" ]; then - systemctl stop jellyfin.service - fi - if [ ! -L %{_sharedstatedir}/%{name}/config ]; then - mv %{_sharedstatedir}/%{name}/config/* %{_sysconfdir}/%{name}/ - rmdir %{_sharedstatedir}/%{name}/config - ln -sf %{_sysconfdir}/%{name} %{_sharedstatedir}/%{name}/config - fi - if [ ! -L %{_sharedstatedir}/%{name}/logs ]; then - mv %{_sharedstatedir}/%{name}/logs/* %{_var}/log/jellyfin - rmdir %{_sharedstatedir}/%{name}/logs - ln -sf %{_var}/log/jellyfin %{_sharedstatedir}/%{name}/logs - fi - if [ ! -L %{_sharedstatedir}/%{name}/cache ]; then - mv %{_sharedstatedir}/%{name}/cache/* %{_var}/cache/jellyfin - rmdir %{_sharedstatedir}/%{name}/cache - ln -sf %{_var}/cache/jellyfin %{_sharedstatedir}/%{name}/cache - fi - if [ "${service_state}" = "active" ]; then - systemctl start jellyfin.service - fi -fi -%systemd_post jellyfin.service - -%preun -%systemd_preun jellyfin.service - -%postun -%systemd_postun_with_restart jellyfin.service - -%changelog -* Fri Oct 11 2019 Jellyfin Packaging Team -- New upstream version 10.5.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.5.0 -* Sat Aug 31 2019 Jellyfin Packaging Team -- New upstream version 10.4.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.4.0 -* Wed Jul 24 2019 Jellyfin Packaging Team -- New upstream version 10.3.7; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.7 -* Sat Jul 06 2019 Jellyfin Packaging Team -- New upstream version 10.3.6; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.6 -* Sun Jun 09 2019 Jellyfin Packaging Team -- New upstream version 10.3.5; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.5 -* Thu Jun 06 2019 Jellyfin Packaging Team -- New upstream version 10.3.4; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.4 -* Fri May 17 2019 Jellyfin Packaging Team -- New upstream version 10.3.3; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.3 -* Tue Apr 30 2019 Jellyfin Packaging Team -- New upstream version 10.3.2; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.2 -* Sat Apr 20 2019 Jellyfin Packaging Team -- New upstream version 10.3.1; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.1 -* Fri Apr 19 2019 Jellyfin Packaging Team -- New upstream version 10.3.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.0 diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin.sudoers b/deployment/old/fedora-package-x64/pkg-src/jellyfin.sudoers deleted file mode 100644 index dd245af4b8..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/jellyfin.sudoers +++ /dev/null @@ -1,19 +0,0 @@ -# Allow jellyfin group to start, stop and restart itself -Cmnd_Alias RESTARTSERVER_SYSTEMD = /usr/bin/systemctl restart jellyfin, /bin/systemctl restart jellyfin -Cmnd_Alias STARTSERVER_SYSTEMD = /usr/bin/systemctl start jellyfin, /bin/systemctl start jellyfin -Cmnd_Alias STOPSERVER_SYSTEMD = /usr/bin/systemctl stop jellyfin, /bin/systemctl stop jellyfin - - -jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSTEMD -jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSTEMD -jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSTEMD - -Defaults!RESTARTSERVER_SYSTEMD !requiretty -Defaults!STARTSERVER_SYSTEMD !requiretty -Defaults!STOPSERVER_SYSTEMD !requiretty - -# Allow the server to mount iso images -jellyfin ALL=(ALL) NOPASSWD: /bin/mount -jellyfin ALL=(ALL) NOPASSWD: /bin/umount - -Defaults:jellyfin !requiretty diff --git a/deployment/old/fedora-package-x64/pkg-src/restart.sh b/deployment/old/fedora-package-x64/pkg-src/restart.sh deleted file mode 100755 index 9b64b6d728..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/restart.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# restart.sh - Jellyfin server restart script -# Part of the Jellyfin project (https://github.com/jellyfin) -# -# This script restarts the Jellyfin daemon on Linux when using -# the Restart button on the admin dashboard. It supports the -# systemctl, service, and traditional /etc/init.d (sysv) restart -# methods, chosen automatically by which one is found first (in -# that order). -# -# This script is used by the Debian/Ubuntu/Fedora/CentOS packages. - -get_service_command() { - for command in systemctl service; do - if which $command &>/dev/null; then - echo $command && return - fi - done - echo "sysv" -} - -cmd="$( get_service_command )" -echo "Detected service control platform '$cmd'; using it to restart Jellyfin..." -case $cmd in - 'systemctl') - echo "sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin" | at now - ;; - 'service') - echo "sleep 2; /usr/bin/sudo $( which service ) jellyfin restart" | at now - ;; - 'sysv') - echo "sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart" | at now - ;; -esac -exit 0 diff --git a/deployment/old/linux-x64/Dockerfile b/deployment/old/linux-x64/Dockerfile deleted file mode 100644 index c47057546d..0000000000 --- a/deployment/old/linux-x64/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/linux-x64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install yarn package manager -RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ - && apt update \ - && apt install -y yarn - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/linux-x64/clean.sh b/deployment/old/linux-x64/clean.sh deleted file mode 100755 index c07501a7bb..0000000000 --- a/deployment/old/linux-x64/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-linux-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/linux-x64/dependencies.txt b/deployment/old/linux-x64/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/linux-x64/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/linux-x64/docker-build.sh b/deployment/old/linux-x64/docker-build.sh deleted file mode 100755 index e33328a36a..0000000000 --- a/deployment/old/linux-x64/docker-build.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# Builds the TAR archive inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Clone down and build Web frontend -web_build_dir="$( mktemp -d )" -web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web" -git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/ -pushd ${web_build_dir} -if [[ -n ${web_branch} ]]; then - checkout -b origin/${web_branch} -fi -yarn install -mkdir -p ${web_target} -mv dist/* ${web_target}/ -popd -rm -rf ${web_build_dir} - -# Get version -version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" - -# Build archives -dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime linux-x64 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true" -tar -cvzf /jellyfin_${version}.portable.tar.gz -C /dist jellyfin_${version} -rm -rf /dist/jellyfin_${version} - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/ -mv /jellyfin[-_]*.tar.gz ${ARTIFACT_DIR}/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/linux-x64/package.sh b/deployment/old/linux-x64/package.sh deleted file mode 100755 index dfe8a9aa4a..0000000000 --- a/deployment/old/linux-x64/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-linux-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/* "${output_dir}" diff --git a/deployment/old/macos/Dockerfile b/deployment/old/macos/Dockerfile deleted file mode 100644 index b522df8848..0000000000 --- a/deployment/old/macos/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/macos -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install yarn package manager -RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ - && apt update \ - && apt install -y yarn - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/macos/clean.sh b/deployment/old/macos/clean.sh deleted file mode 100755 index c07501a7bb..0000000000 --- a/deployment/old/macos/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-linux-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/macos/dependencies.txt b/deployment/old/macos/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/macos/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/macos/docker-build.sh b/deployment/old/macos/docker-build.sh deleted file mode 100755 index f9417388d7..0000000000 --- a/deployment/old/macos/docker-build.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# Builds the TAR archive inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Clone down and build Web frontend -web_build_dir="$( mktemp -d )" -web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web" -git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/ -pushd ${web_build_dir} -if [[ -n ${web_branch} ]]; then - checkout -b origin/${web_branch} -fi -yarn install -mkdir -p ${web_target} -mv dist/* ${web_target}/ -popd -rm -rf ${web_build_dir} - -# Get version -version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" - -# Build archives -dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime osx-x64 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true" -tar -cvzf /jellyfin_${version}.portable.tar.gz -C /dist jellyfin_${version} -rm -rf /dist/jellyfin_${version} - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/ -mv /jellyfin[-_]*.tar.gz ${ARTIFACT_DIR}/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/macos/package.sh b/deployment/old/macos/package.sh deleted file mode 100755 index 464c0d382f..0000000000 --- a/deployment/old/macos/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-macos-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/* "${output_dir}" diff --git a/deployment/old/portable/Dockerfile b/deployment/old/portable/Dockerfile deleted file mode 100644 index 965eb82b86..0000000000 --- a/deployment/old/portable/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/portable -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install yarn package manager -RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ - && apt update \ - && apt install -y yarn - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/portable/clean.sh b/deployment/old/portable/clean.sh deleted file mode 100755 index c07501a7bb..0000000000 --- a/deployment/old/portable/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-linux-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/portable/dependencies.txt b/deployment/old/portable/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/portable/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/portable/docker-build.sh b/deployment/old/portable/docker-build.sh deleted file mode 100755 index 094190bbf6..0000000000 --- a/deployment/old/portable/docker-build.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# Builds the TAR archive inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Clone down and build Web frontend -web_build_dir="$( mktemp -d )" -web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web" -git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/ -pushd ${web_build_dir} -if [[ -n ${web_branch} ]]; then - checkout -b origin/${web_branch} -fi -yarn install -mkdir -p ${web_target} -mv dist/* ${web_target}/ -popd -rm -rf ${web_build_dir} - -# Get version -version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" - -# Build archives -dotnet publish Jellyfin.Server --configuration Release --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" -tar -cvzf /jellyfin_${version}.portable.tar.gz -C /dist jellyfin_${version} -rm -rf /dist/jellyfin_${version} - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/ -mv /jellyfin[-_]*.tar.gz ${ARTIFACT_DIR}/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/portable/package.sh b/deployment/old/portable/package.sh deleted file mode 100755 index 0ceb54dda1..0000000000 --- a/deployment/old/portable/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-portable-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/* "${output_dir}" diff --git a/deployment/old/ubuntu-package-arm64/Dockerfile.amd64 b/deployment/old/ubuntu-package-arm64/Dockerfile.amd64 deleted file mode 100644 index b11994a18a..0000000000 --- a/deployment/old/ubuntu-package-arm64/Dockerfile.amd64 +++ /dev/null @@ -1,59 +0,0 @@ -FROM ubuntu:bionic -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/ubuntu-package-arm64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install npm package manager -RUN wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ - && echo "deb https://deb.nodesource.com/node_10.x $(lsb_release -s -c) main" > /etc/apt/sources.list.d/npm.list \ - && apt update \ - && apt install -y nodejs - -# Prepare the cross-toolchain -RUN rm /etc/apt/sources.list \ - && export CODENAME="$( lsb_release -c -s )" \ - && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ - && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ - && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ - && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ - && echo "deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/arm64.list \ - && echo "deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/arm64.list \ - && echo "deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/arm64.list \ - && echo "deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/arm64.list \ - && dpkg --add-architecture arm64 \ - && apt-get update \ - && apt-get install -y cross-gcc-dev \ - && TARGET_LIST="arm64" cross-gcc-gensource 6 \ - && cd cross-gcc-packages-amd64/cross-gcc-6-arm64 \ - && ln -fs /usr/share/zoneinfo/America/Toronto /etc/localtime \ - && apt-get install -y gcc-6-source libstdc++6-arm64-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libcloog-isl-dev libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:arm64 linux-libc-dev:arm64 libgcc1:arm64 libcurl4-openssl-dev:arm64 libfontconfig1-dev:arm64 libfreetype6-dev:arm64 liblttng-ust0:arm64 libstdc++6:arm64 libssl-dev:arm64 - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/ubuntu-package-arm64/Dockerfile.arm64 b/deployment/old/ubuntu-package-arm64/Dockerfile.arm64 deleted file mode 100644 index 8f004b2f1a..0000000000 --- a/deployment/old/ubuntu-package-arm64/Dockerfile.arm64 +++ /dev/null @@ -1,40 +0,0 @@ -FROM ubuntu:bionic -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/ubuntu-package-arm64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=arm64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev liblttng-ust0 libssl-dev - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/5a4c8f96-1c73-401c-a6de-8e100403188a/0ce6ab39747e2508366d498f9c0a0669/dotnet-sdk-3.1.100-linux-arm64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install npm package manager -RUN wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ - && echo "deb https://deb.nodesource.com/node_10.x $(lsb_release -s -c) main" > /etc/apt/sources.list.d/npm.list \ - && apt update \ - && apt install -y nodejs - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/ubuntu-package-arm64/clean.sh b/deployment/old/ubuntu-package-arm64/clean.sh deleted file mode 100755 index 82d427f9e5..0000000000 --- a/deployment/old/ubuntu-package-arm64/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-ubuntu-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/ubuntu-package-arm64/dependencies.txt b/deployment/old/ubuntu-package-arm64/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/ubuntu-package-arm64/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/ubuntu-package-arm64/docker-build.sh b/deployment/old/ubuntu-package-arm64/docker-build.sh deleted file mode 100755 index 67ab6bd74b..0000000000 --- a/deployment/old/ubuntu-package-arm64/docker-build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Builds the DEB inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image -sed -i '/dotnet-sdk-3.1,/d' debian/control - -# Build DEB -export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} -dpkg-buildpackage -us -uc -aarm64 - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/deb -mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/ubuntu-package-arm64/package.sh b/deployment/old/ubuntu-package-arm64/package.sh deleted file mode 100755 index d1140a7274..0000000000 --- a/deployment/old/ubuntu-package-arm64/package.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -ARCH="$( arch )" -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-ubuntu_arm64-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Determine which Dockerfile to use -case $ARCH in - 'x86_64') - DOCKERFILE="Dockerfile.amd64" - ;; - 'armv7l') - DOCKERFILE="Dockerfile.arm64" - ;; -esac - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./${DOCKERFILE} -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/ubuntu-package-arm64/pkg-src b/deployment/old/ubuntu-package-arm64/pkg-src deleted file mode 120000 index 4c695fea17..0000000000 --- a/deployment/old/ubuntu-package-arm64/pkg-src +++ /dev/null @@ -1 +0,0 @@ -../debian-package-x64/pkg-src \ No newline at end of file diff --git a/deployment/old/ubuntu-package-armhf/Dockerfile.amd64 b/deployment/old/ubuntu-package-armhf/Dockerfile.amd64 deleted file mode 100644 index e475b14389..0000000000 --- a/deployment/old/ubuntu-package-armhf/Dockerfile.amd64 +++ /dev/null @@ -1,59 +0,0 @@ -FROM ubuntu:bionic -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/ubuntu-package-armhf -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install npm package manager -RUN wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ - && echo "deb https://deb.nodesource.com/node_10.x $(lsb_release -s -c) main" > /etc/apt/sources.list.d/npm.list \ - && apt update \ - && apt install -y nodejs - -# Prepare the cross-toolchain -RUN rm /etc/apt/sources.list \ - && export CODENAME="$( lsb_release -c -s )" \ - && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ - && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ - && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ - && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ - && echo "deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/armhf.list \ - && echo "deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/armhf.list \ - && echo "deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/armhf.list \ - && echo "deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/armhf.list \ - && dpkg --add-architecture armhf \ - && apt-get update \ - && apt-get install -y cross-gcc-dev \ - && TARGET_LIST="armhf" cross-gcc-gensource 6 \ - && cd cross-gcc-packages-amd64/cross-gcc-6-armhf \ - && ln -fs /usr/share/zoneinfo/America/Toronto /etc/localtime \ - && apt-get install -y gcc-6-source libstdc++6-armhf-cross binutils-arm-linux-gnueabihf bison flex libtool gdb sharutils netbase libcloog-isl-dev libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:armhf linux-libc-dev:armhf libgcc1:armhf libcurl4-openssl-dev:armhf libfontconfig1-dev:armhf libfreetype6-dev:armhf liblttng-ust0:armhf libstdc++6:armhf libssl-dev:armhf - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/ubuntu-package-armhf/Dockerfile.armhf b/deployment/old/ubuntu-package-armhf/Dockerfile.armhf deleted file mode 100644 index 0e71fa6938..0000000000 --- a/deployment/old/ubuntu-package-armhf/Dockerfile.armhf +++ /dev/null @@ -1,40 +0,0 @@ -FROM ubuntu:bionic -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/ubuntu-package-armhf -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=armhf - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev liblttng-ust0 libssl-dev - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/67766a96-eb8c-4cd2-bca4-ea63d2cc115c/7bf13840aa2ed88793b7315d5e0d74e6/dotnet-sdk-3.1.100-linux-arm.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install npm package manager -RUN wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ - && echo "deb https://deb.nodesource.com/node_10.x $(lsb_release -s -c) main" > /etc/apt/sources.list.d/npm.list \ - && apt update \ - && apt install -y nodejs - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/ubuntu-package-armhf/clean.sh b/deployment/old/ubuntu-package-armhf/clean.sh deleted file mode 100755 index 82d427f9e5..0000000000 --- a/deployment/old/ubuntu-package-armhf/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-ubuntu-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/ubuntu-package-armhf/dependencies.txt b/deployment/old/ubuntu-package-armhf/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/ubuntu-package-armhf/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/ubuntu-package-armhf/docker-build.sh b/deployment/old/ubuntu-package-armhf/docker-build.sh deleted file mode 100755 index 1bd7fb2911..0000000000 --- a/deployment/old/ubuntu-package-armhf/docker-build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Builds the DEB inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image -sed -i '/dotnet-sdk-3.1,/d' debian/control - -# Build DEB -export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} -dpkg-buildpackage -us -uc -aarmhf - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/deb -mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/ubuntu-package-armhf/package.sh b/deployment/old/ubuntu-package-armhf/package.sh deleted file mode 100755 index 2ceb3e8165..0000000000 --- a/deployment/old/ubuntu-package-armhf/package.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -ARCH="$( arch )" -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-ubuntu_armhf-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Determine which Dockerfile to use -case $ARCH in - 'x86_64') - DOCKERFILE="Dockerfile.amd64" - ;; - 'armv7l') - DOCKERFILE="Dockerfile.armhf" - ;; -esac - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./${DOCKERFILE} -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/ubuntu-package-armhf/pkg-src b/deployment/old/ubuntu-package-armhf/pkg-src deleted file mode 120000 index 4c695fea17..0000000000 --- a/deployment/old/ubuntu-package-armhf/pkg-src +++ /dev/null @@ -1 +0,0 @@ -../debian-package-x64/pkg-src \ No newline at end of file diff --git a/deployment/old/ubuntu-package-x64/Dockerfile b/deployment/old/ubuntu-package-x64/Dockerfile deleted file mode 100644 index e2dda6392c..0000000000 --- a/deployment/old/ubuntu-package-x64/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -FROM ubuntu:bionic -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/ubuntu-package-x64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Ubuntu build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev liblttng-ust0 \ - && ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh \ - && mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install npm package manager -RUN wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ - && echo "deb https://deb.nodesource.com/node_10.x $(lsb_release -s -c) main" > /etc/apt/sources.list.d/npm.list \ - && apt update \ - && apt install -y nodejs - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/ubuntu-package-x64/clean.sh b/deployment/old/ubuntu-package-x64/clean.sh deleted file mode 100755 index 82d427f9e5..0000000000 --- a/deployment/old/ubuntu-package-x64/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-ubuntu-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/ubuntu-package-x64/dependencies.txt b/deployment/old/ubuntu-package-x64/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/ubuntu-package-x64/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/ubuntu-package-x64/docker-build.sh b/deployment/old/ubuntu-package-x64/docker-build.sh deleted file mode 100755 index 962a522ebc..0000000000 --- a/deployment/old/ubuntu-package-x64/docker-build.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# Builds the DEB inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image -sed -i '/dotnet-sdk-3.1,/d' debian/control - -# Build DEB -dpkg-buildpackage -us -uc - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/deb -mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/ubuntu-package-x64/package.sh b/deployment/old/ubuntu-package-x64/package.sh deleted file mode 100755 index 08c003778b..0000000000 --- a/deployment/old/ubuntu-package-x64/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-ubuntu-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/ubuntu-package-x64/pkg-src b/deployment/old/ubuntu-package-x64/pkg-src deleted file mode 120000 index 0bb6d55249..0000000000 --- a/deployment/old/ubuntu-package-x64/pkg-src +++ /dev/null @@ -1 +0,0 @@ -../debian-package-x64/pkg-src/ \ No newline at end of file diff --git a/deployment/old/unraid/docker-templates/README.md b/deployment/old/unraid/docker-templates/README.md deleted file mode 100644 index 2c268e8b3e..0000000000 --- a/deployment/old/unraid/docker-templates/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# docker-templates - -### Installation: - -Open unRaid GUI (at least unRaid 6.5) - -Click on the Docker tab - -Add the following line under "Template Repositories" - -https://github.com/jellyfin/jellyfin/blob/master/deployment/unraid/docker-templates - -Click save than click on Add Container and select jellyfin. - -Adjust to your paths to your liking and off you go! diff --git a/deployment/old/unraid/docker-templates/jellyfin.xml b/deployment/old/unraid/docker-templates/jellyfin.xml deleted file mode 100644 index 57b4cc5ae1..0000000000 --- a/deployment/old/unraid/docker-templates/jellyfin.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - https://raw.githubusercontent.com/jellyfin/jellyfin/deployment/unraid/docker-templates/jellyfin.xml - False - MediaApp:Video MediaApp:Music MediaApp:Photos MediaServer:Video MediaServer:Music MediaServer:Photos - Jellyfin - - Jellyfin is The Free Software Media Browser Converted By Community Applications Always verify this template (and values) against the dockerhub support page for the container!![br][br] - You can add as many mount points as needed for recordings, movies ,etc. [br][br] - [b][span style='color: #E80000;']Directions:[/span][/b][br] - [b]/config[/b] : This is where Jellyfin will store it's databases and configuration.[br][br] - [b]Port[/b] : This is the default port for Jellyfin. (Will add ssl port later)[br][br] - [b]Media[/b] : This is the mounting point of your media. When you access it in Jellyfin it will be /media or whatever you chose for a mount point[br][br] - [b]Cache[/b] : This is where Jellyfin will store and manage cached files like images to serve to clients. This is not where all images are stored.[br][br] - [b]Tip:[/b] You can add more volume mappings if you wish Jellyfin has access to it. - - - Jellyfin Server is a home media server built on top of other popular open source technologies such as Service Stack, jQuery, jQuery mobile, and Mono and will remain completely free! - - https://www.reddit.com/r/jellyfin/ - https://hub.docker.com/r/jellyfin/jellyfin/ - https://github.com/jellyfin/jellyfin/> - jellyfin/jellyfin - https://jellyfin.media/ - true - false - - host - - - 8096 - 8096 - tcp - - - - - - /mnt/user/appdata/Jellyfin - /config - rw - - - /mnt/user - /media - rw - - - /mnt/user/appdata/Jellyfin/cache/ - /cache - rw - - - http://[IP]:[PORT:8096]/ - https://raw.githubusercontent.com/binhex/docker-templates/master/binhex/images/jellyfin-icon.png - - diff --git a/deployment/old/win-x64/Dockerfile b/deployment/old/win-x64/Dockerfile deleted file mode 100644 index 8a33749541..0000000000 --- a/deployment/old/win-x64/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/win-x64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 zip - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install yarn package manager -RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ - && apt update \ - && apt install -y yarn - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/win-x64/clean.sh b/deployment/old/win-x64/clean.sh deleted file mode 100755 index 6c183f3371..0000000000 --- a/deployment/old/win-x64/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-windows-x64-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/win-x64/dependencies.txt b/deployment/old/win-x64/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/win-x64/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/win-x64/docker-build.sh b/deployment/old/win-x64/docker-build.sh deleted file mode 100755 index 79e5fb0bcd..0000000000 --- a/deployment/old/win-x64/docker-build.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -# Builds the ZIP archive inside the Docker container - -set -o errexit -set -o xtrace - -# Version variables -NSSM_VERSION="nssm-2.24-101-g897c7ad" -NSSM_URL="http://files.evilt.win/nssm/${NSSM_VERSION}.zip" -FFMPEG_VERSION="ffmpeg-4.2.1-win64-static" -FFMPEG_URL="https://ffmpeg.zeranoe.com/builds/win64/static/${FFMPEG_VERSION}.zip" - -# Move to source directory -pushd ${SOURCE_DIR} - -# Clone down and build Web frontend -web_build_dir="$( mktemp -d )" -web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web" -git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/ -pushd ${web_build_dir} -if [[ -n ${web_branch} ]]; then - checkout -b origin/${web_branch} -fi -yarn install -mkdir -p ${web_target} -mv dist/* ${web_target}/ -popd -rm -rf ${web_build_dir} - -# Get version -version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" - -# Build binary -dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime win-x64 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true" - -# Prepare addins -addin_build_dir="$( mktemp -d )" -wget ${NSSM_URL} -O ${addin_build_dir}/nssm.zip -wget ${FFMPEG_URL} -O ${addin_build_dir}/ffmpeg.zip -unzip ${addin_build_dir}/nssm.zip -d ${addin_build_dir} -cp ${addin_build_dir}/${NSSM_VERSION}/win64/nssm.exe /dist/jellyfin_${version}/nssm.exe -unzip ${addin_build_dir}/ffmpeg.zip -d ${addin_build_dir} -cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffmpeg.exe /dist/jellyfin_${version}/ffmpeg.exe -cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffprobe.exe /dist/jellyfin_${version}/ffprobe.exe -rm -rf ${addin_build_dir} - -# Prepare scripts -cp ${SOURCE_DIR}/deployment/windows/legacy/install-jellyfin.ps1 /dist/jellyfin_${version}/install-jellyfin.ps1 -cp ${SOURCE_DIR}/deployment/windows/legacy/install.bat /dist/jellyfin_${version}/install.bat - -# Create zip package -pushd /dist -zip -r /jellyfin_${version}.portable.zip jellyfin_${version} -popd -rm -rf /dist/jellyfin_${version} - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/ -mv /jellyfin[-_]*.zip ${ARTIFACT_DIR}/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/win-x64/package.sh b/deployment/old/win-x64/package.sh deleted file mode 100755 index a8ab190fa5..0000000000 --- a/deployment/old/win-x64/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-windows-x64-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/* "${output_dir}" diff --git a/deployment/old/win-x86/Dockerfile b/deployment/old/win-x86/Dockerfile deleted file mode 100644 index f8dc5be83d..0000000000 --- a/deployment/old/win-x86/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/win-x86 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 zip - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install yarn package manager -RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ - && apt update \ - && apt install -y yarn - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/win-x86/clean.sh b/deployment/old/win-x86/clean.sh deleted file mode 100755 index 8b78c5e4b6..0000000000 --- a/deployment/old/win-x86/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-windows-x86-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/win-x86/dependencies.txt b/deployment/old/win-x86/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/win-x86/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/win-x86/docker-build.sh b/deployment/old/win-x86/docker-build.sh deleted file mode 100755 index 977dcf78fa..0000000000 --- a/deployment/old/win-x86/docker-build.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -# Builds the ZIP archive inside the Docker container - -set -o errexit -set -o xtrace - -# Version variables -NSSM_VERSION="nssm-2.24-101-g897c7ad" -NSSM_URL="http://files.evilt.win/nssm/${NSSM_VERSION}.zip" -FFMPEG_VERSION="ffmpeg-4.2.1-win32-static" -FFMPEG_URL="https://ffmpeg.zeranoe.com/builds/win32/static/${FFMPEG_VERSION}.zip" - -# Move to source directory -pushd ${SOURCE_DIR} - -# Clone down and build Web frontend -web_build_dir="$( mktemp -d )" -web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web" -git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/ -pushd ${web_build_dir} -if [[ -n ${web_branch} ]]; then - checkout -b origin/${web_branch} -fi -yarn install -mkdir -p ${web_target} -mv dist/* ${web_target}/ -popd -rm -rf ${web_build_dir} - -# Get version -version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" - -# Build binary -dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime win-x86 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true" - -# Prepare addins -addin_build_dir="$( mktemp -d )" -wget ${NSSM_URL} -O ${addin_build_dir}/nssm.zip -wget ${FFMPEG_URL} -O ${addin_build_dir}/ffmpeg.zip -unzip ${addin_build_dir}/nssm.zip -d ${addin_build_dir} -cp ${addin_build_dir}/${NSSM_VERSION}/win64/nssm.exe /dist/jellyfin_${version}/nssm.exe -unzip ${addin_build_dir}/ffmpeg.zip -d ${addin_build_dir} -cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffmpeg.exe /dist/jellyfin_${version}/ffmpeg.exe -cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffprobe.exe /dist/jellyfin_${version}/ffprobe.exe -rm -rf ${addin_build_dir} - -# Prepare scripts -cp ${SOURCE_DIR}/deployment/windows/legacy/install-jellyfin.ps1 /dist/jellyfin_${version}/install-jellyfin.ps1 -cp ${SOURCE_DIR}/deployment/windows/legacy/install.bat /dist/jellyfin_${version}/install.bat - -# Create zip package -pushd /dist -zip -r /jellyfin_${version}.portable.zip jellyfin_${version} -popd -rm -rf /dist/jellyfin_${version} - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/ -mv /jellyfin[-_]*.zip ${ARTIFACT_DIR}/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/win-x86/package.sh b/deployment/old/win-x86/package.sh deleted file mode 100755 index 65e7e2928c..0000000000 --- a/deployment/old/win-x86/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-windows-x86-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/* "${output_dir}" From cd616746b9ec4c1e07b84e207104bad01c614dae Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 24 Mar 2020 11:17:01 -0400 Subject: [PATCH 038/115] Use more specific mv source glob --- deployment/build.debian.amd64 | 2 +- deployment/build.debian.arm64 | 2 +- deployment/build.debian.armhf | 2 +- deployment/build.ubuntu.amd64 | 2 +- deployment/build.ubuntu.arm64 | 2 +- deployment/build.ubuntu.armhf | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deployment/build.debian.amd64 b/deployment/build.debian.amd64 index beaf02bee2..f44c6a7d1d 100755 --- a/deployment/build.debian.amd64 +++ b/deployment/build.debian.amd64 @@ -18,7 +18,7 @@ fi dpkg-buildpackage -us -uc --pre-clean --post-clean mkdir -p ${ARTIFACT_DIR}/ -mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ +mv ../jellyfin*.{deb,dsc,tar.gz,buildinfo,changes} ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then cp -a /tmp/control.orig debian/control diff --git a/deployment/build.debian.arm64 b/deployment/build.debian.arm64 index 6394dddb02..0127671f3d 100755 --- a/deployment/build.debian.arm64 +++ b/deployment/build.debian.arm64 @@ -19,7 +19,7 @@ export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} dpkg-buildpackage -us -uc -a arm64 --pre-clean --post-clean mkdir -p ${ARTIFACT_DIR}/ -mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ +mv ../jellyfin*.{deb,dsc,tar.gz,buildinfo,changes} ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then cp -a /tmp/control.orig debian/control diff --git a/deployment/build.debian.armhf b/deployment/build.debian.armhf index d12660760f..02e3db4fca 100755 --- a/deployment/build.debian.armhf +++ b/deployment/build.debian.armhf @@ -19,7 +19,7 @@ export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} dpkg-buildpackage -us -uc -a armhf --pre-clean --post-clean mkdir -p ${ARTIFACT_DIR}/ -mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ +mv ../jellyfin*.{deb,dsc,tar.gz,buildinfo,changes} ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then cp -a /tmp/control.orig debian/control diff --git a/deployment/build.ubuntu.amd64 b/deployment/build.ubuntu.amd64 index 1b90f68f46..107ddbe02d 100755 --- a/deployment/build.ubuntu.amd64 +++ b/deployment/build.ubuntu.amd64 @@ -18,7 +18,7 @@ fi dpkg-buildpackage -us -uc --pre-clean --post-clean mkdir -p ${ARTIFACT_DIR}/ -mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ +mv ../jellyfin*.{deb,dsc,tar.gz,buildinfo,changes} ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then cp -a /tmp/control.orig debian/control diff --git a/deployment/build.ubuntu.arm64 b/deployment/build.ubuntu.arm64 index c0a31d764f..b13868f44b 100755 --- a/deployment/build.ubuntu.arm64 +++ b/deployment/build.ubuntu.arm64 @@ -19,7 +19,7 @@ export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} dpkg-buildpackage -us -uc -a arm64 --pre-clean --post-clean mkdir -p ${ARTIFACT_DIR}/ -mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ +mv ../jellyfin*.{deb,dsc,tar.gz,buildinfo,changes} ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then cp -a /tmp/control.orig debian/control diff --git a/deployment/build.ubuntu.armhf b/deployment/build.ubuntu.armhf index e2129357dd..0b4dd308a2 100755 --- a/deployment/build.ubuntu.armhf +++ b/deployment/build.ubuntu.armhf @@ -19,7 +19,7 @@ export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} dpkg-buildpackage -us -uc -a armhf --pre-clean --post-clean mkdir -p ${ARTIFACT_DIR}/ -mv ../jellyfin[-_]* ${ARTIFACT_DIR}/ +mv ../jellyfin*.{deb,dsc,tar.gz,buildinfo,changes} ${ARTIFACT_DIR}/ if [[ ${IS_DOCKER} == YES ]]; then cp -a /tmp/control.orig debian/control From 8094687b9c589038ce87879c51785cd63c8ef8ac Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 30 Mar 2020 02:40:06 -0400 Subject: [PATCH 039/115] Add Debian/Ubuntu metapackage equivs file --- debian/metapackage/jellyfin | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 debian/metapackage/jellyfin diff --git a/debian/metapackage/jellyfin b/debian/metapackage/jellyfin new file mode 100644 index 0000000000..9a41eafaed --- /dev/null +++ b/debian/metapackage/jellyfin @@ -0,0 +1,13 @@ +Source: jellyfin +Section: misc +Priority: optional +Homepage: https://jellyfin.org +Standards-Version: 3.9.2 + +Package: jellyfin +Version: 10.6.0 +Maintainer: Jellyfin Packaging Team +Depends: jellyfin-server, jellyfin-web +Description: Provides the Jellyfin Free Software Media System + Provides the full Jellyfin experience, including both the server and web interface. + From 49da8766d8aac23ab6f6c64a4fee1885b04918f3 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 30 Mar 2020 02:43:13 -0400 Subject: [PATCH 040/115] Update bump_version script 1. Remove some cruft 2. Update the metapackage as well 3. Changelogs are automated, don't bother EDITOR-ing them --- bump_version | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/bump_version b/bump_version index 106dd7a78e..c868c541e6 100755 --- a/bump_version +++ b/bump_version @@ -10,10 +10,6 @@ usage() { echo -e "" echo -e "Usage:" echo -e " $ bump_version " - echo -e "" - echo -e "The web_branch defaults to the same branch name as the current main branch." - echo -e "This helps facilitate releases where both branches would be called release-X.Y.Z" - echo -e "and would already be created before running this script." } if [[ -z $1 ]]; then @@ -54,37 +50,28 @@ else new_version_deb="${new_version}-1" fi -# Set the Dockerfile web version to the specified new_version -old_version="$( - grep "JELLYFIN_WEB_VERSION=" Dockerfile \ - | sed -E 's/ARG JELLYFIN_WEB_VERSION=v([0-9\.]+[-a-z0-9]*)/\1/' -)" -echo $old_version - -old_version_sed="$( sed 's/\./\\./g' <<<"${old_version}" )" # Escape the '.' chars -sed -i "s/${old_version_sed}/${new_version}/g" Dockerfile* +# Update the metapackage equivs file +debian_equivs_file="debian/metapackage/jellyfin" +sed -i "s/${old_version_sed}/${new_version}/g" ${debian_equivs_file} # Write out a temporary Debian changelog with our new stuff appended and some templated formatting -debian_changelog_file="deployment/debian-package-x64/pkg-src/changelog" +debian_changelog_file="debian/changelog" debian_changelog_temp="$( mktemp )" # Create new temp file with our changelog -echo -e "### DEBIAN PACKAGE CHANGELOG: Verify this file looks correct or edit accordingly, then delete this line, write, and exit. -jellyfin (${new_version_deb}) unstable; urgency=medium +echo -e "jellyfin (${new_version_deb}) unstable; urgency=medium * New upstream version ${new_version}; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v${new_version} -- Jellyfin Packaging Team $( date --rfc-2822 ) " >> ${debian_changelog_temp} cat ${debian_changelog_file} >> ${debian_changelog_temp} -# Edit the file to verify -$EDITOR ${debian_changelog_temp} # Move into place mv ${debian_changelog_temp} ${debian_changelog_file} # Clean up rm -f ${debian_changelog_temp} # Write out a temporary Yum changelog with our new stuff prepended and some templated formatting -fedora_spec_file="deployment/fedora-package-x64/pkg-src/jellyfin.spec" +fedora_spec_file="fedora/jellyfin.spec" fedora_changelog_temp="$( mktemp )" fedora_spec_temp_dir="$( mktemp -d )" fedora_spec_temp="${fedora_spec_temp_dir}/jellyfin.spec.tmp" @@ -98,13 +85,10 @@ sed -i "s/${old_version_sed}/${new_version_sed}/g" xx00 # Remove the header from xx01 sed -i '/^%changelog/d' xx01 # Create new temp file with our changelog -echo -e "### YUM SPEC CHANGELOG: Verify this file looks correct or edit accordingly, then delete this line, write, and exit. -%changelog +echo -e "%changelog * $( LANG=C date '+%a %b %d %Y' ) Jellyfin Packaging Team - New upstream version ${new_version}; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v${new_version}" >> ${fedora_changelog_temp} cat xx01 >> ${fedora_changelog_temp} -# Edit the file to verify -$EDITOR ${fedora_changelog_temp} # Reassembble cat xx00 ${fedora_changelog_temp} > ${fedora_spec_temp} popd @@ -114,5 +98,5 @@ mv ${fedora_spec_temp} ${fedora_spec_file} rm -rf ${fedora_changelog_temp} ${fedora_spec_temp_dir} # Stage the changed files for commit -git add ${shared_version_file} ${build_file} ${debian_changelog_file} ${fedora_spec_file} Dockerfile* +git add ${shared_version_file} ${build_file} ${debian_equivs_file} ${debian_changelog_file} ${fedora_spec_file} git status From e85f9f5613c009a47c9b59ac59cd5930fc45d96a Mon Sep 17 00:00:00 2001 From: Vasily Date: Tue, 7 Apr 2020 18:41:15 +0300 Subject: [PATCH 041/115] Make localhost LiveTV restreams always use plain HTTP port --- Emby.Server.Implementations/ApplicationHost.cs | 17 +++++++++-------- .../LiveTv/EmbyTV/EmbyTV.cs | 2 +- .../TunerHosts/HdHomerun/HdHomerunUdpStream.cs | 2 +- .../LiveTv/TunerHosts/SharedHttpStream.cs | 2 +- .../IServerApplicationHost.cs | 10 +++++++--- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index cb32b8c01b..9af89112c5 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1419,7 +1419,7 @@ namespace Emby.Server.Implementations public bool SupportsHttps => Certificate != null || ServerConfigurationManager.Configuration.IsBehindProxy; - public async Task GetLocalApiUrl(CancellationToken cancellationToken) + public async Task GetLocalApiUrl(CancellationToken cancellationToken, bool forceHttp=false) { try { @@ -1428,7 +1428,7 @@ namespace Emby.Server.Implementations foreach (var address in addresses) { - return GetLocalApiUrl(address); + return GetLocalApiUrl(address, forceHttp); } return null; @@ -1458,7 +1458,7 @@ namespace Emby.Server.Implementations } /// - public string GetLocalApiUrl(IPAddress ipAddress) + public string GetLocalApiUrl(IPAddress ipAddress, bool forceHttp=false) { if (ipAddress.AddressFamily == AddressFamily.InterNetworkV6) { @@ -1468,20 +1468,21 @@ namespace Emby.Server.Implementations str.CopyTo(span.Slice(1)); span[^1] = ']'; - return GetLocalApiUrl(span); + return GetLocalApiUrl(span, forceHttp); } - return GetLocalApiUrl(ipAddress.ToString()); + return GetLocalApiUrl(ipAddress.ToString(), forceHttp); } /// - public string GetLocalApiUrl(ReadOnlySpan host) + public string GetLocalApiUrl(ReadOnlySpan host, bool forceHttp=false) { var url = new StringBuilder(64); - url.Append(EnableHttps ? "https://" : "http://") + bool useHttps = EnableHttps && !forceHttp; + url.Append(useHttps ? "https://" : "http://") .Append(host) .Append(':') - .Append(EnableHttps ? HttpsPort : HttpPort); + .Append(useHttps ? HttpsPort : HttpPort); string baseUrl = ServerConfigurationManager.Configuration.BaseUrl; if (baseUrl.Length != 0) diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 139aa19a4b..409917245f 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -1062,7 +1062,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV { var stream = new MediaSourceInfo { - EncoderPath = _appHost.GetLocalApiUrl("127.0.0.1") + "/LiveTv/LiveRecordings/" + info.Id + "/stream", + EncoderPath = _appHost.GetLocalApiUrl("127.0.0.1", true) + "/LiveTv/LiveRecordings/" + info.Id + "/stream", EncoderProtocol = MediaProtocol.Http, Path = info.Path, Protocol = MediaProtocol.File, diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs index 03ee5bfb65..d89a816b3b 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs @@ -121,7 +121,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun //OpenedMediaSource.Path = tempFile; //OpenedMediaSource.ReadAtNativeFramerate = true; - MediaSource.Path = _appHost.GetLocalApiUrl("127.0.0.1") + "/LiveTv/LiveStreamFiles/" + UniqueId + "/stream.ts"; + MediaSource.Path = _appHost.GetLocalApiUrl("127.0.0.1", true) + "/LiveTv/LiveStreamFiles/" + UniqueId + "/stream.ts"; MediaSource.Protocol = MediaProtocol.Http; //OpenedMediaSource.SupportsDirectPlay = false; //OpenedMediaSource.SupportsDirectStream = true; diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs index d63588bbd1..0e600202aa 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs @@ -106,7 +106,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts //OpenedMediaSource.Path = tempFile; //OpenedMediaSource.ReadAtNativeFramerate = true; - MediaSource.Path = _appHost.GetLocalApiUrl("127.0.0.1") + "/LiveTv/LiveStreamFiles/" + UniqueId + "/stream.ts"; + MediaSource.Path = _appHost.GetLocalApiUrl("127.0.0.1", true) + "/LiveTv/LiveStreamFiles/" + UniqueId + "/stream.ts"; MediaSource.Protocol = MediaProtocol.Http; //OpenedMediaSource.Path = TempFilePath; diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.cs index 608ffc61c2..09f6cb0431 100644 --- a/MediaBrowser.Controller/IServerApplicationHost.cs +++ b/MediaBrowser.Controller/IServerApplicationHost.cs @@ -65,22 +65,26 @@ namespace MediaBrowser.Controller /// /// Gets the local API URL. /// + /// Token to cancel the request if needed. + /// Whether to force usage of plain HTTP protocol. /// The local API URL. - Task GetLocalApiUrl(CancellationToken cancellationToken); + Task GetLocalApiUrl(CancellationToken cancellationToken, bool forceHttp=false); /// /// Gets the local API URL. /// /// The hostname. + /// Whether to force usage of plain HTTP protocol. /// The local API URL. - string GetLocalApiUrl(ReadOnlySpan hostname); + string GetLocalApiUrl(ReadOnlySpan hostname, bool forceHttp=false); /// /// Gets the local API URL. /// /// The IP address. + /// Whether to force usage of plain HTTP protocol. /// The local API URL. - string GetLocalApiUrl(IPAddress address); + string GetLocalApiUrl(IPAddress address, bool forceHttp=false); /// /// Open a URL in an external browser window. From 626d4dab1062050cca8b4755c79da498f4fed0b7 Mon Sep 17 00:00:00 2001 From: Vasily Date: Wed, 8 Apr 2020 13:41:11 +0300 Subject: [PATCH 042/115] Make sure Jellyfin listens on localhost no matter what This is needed by LiveTV --- Jellyfin.Server/Program.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index e55b0d4ed9..efb049a5bb 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -267,9 +267,15 @@ namespace Jellyfin.Server .LocalNetworkAddresses .Select(appHost.NormalizeConfiguredLocalAddress) .Where(i => i != null) - .ToList(); - if (addresses.Any()) + .ToHashSet(); + if (addresses.Any() && !addresses.Contains(IPAddress.Any)) { + if (!addresses.Contains(IPAddress.Loopback)) + { + // we must listen on loopback for LiveTV to function regardless of the settings + addresses.Add(IPAddress.Loopback); + } + foreach (var address in addresses) { _logger.LogInformation("Kestrel listening on {IpAddress}", address); From 9eab678487e107939e206ec66b0f573463486082 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 9 Apr 2020 11:17:38 -0400 Subject: [PATCH 043/115] Improve Fedora spec and add metapackage --- fedora/jellyfin.spec | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/fedora/jellyfin.spec b/fedora/jellyfin.spec index c15b4ee957..4071babcdc 100644 --- a/fedora/jellyfin.spec +++ b/fedora/jellyfin.spec @@ -6,10 +6,10 @@ %global dotnet_runtime centos-x64 %endif -Name: jellyfin-server +Name: jellyfin Version: 10.6.0 Release: 1%{?dist} -Summary: The Free Software Media System Server backend and API +Summary: The Free Software Media System License: GPLv3 URL: https://jellyfin.media # Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%{version}.tar.gz` @@ -23,22 +23,27 @@ Source16: jellyfin-firewalld.xml %{?systemd_requires} BuildRequires: systemd -Requires(pre): shadow-utils BuildRequires: libcurl-devel, fontconfig-devel, freetype-devel, openssl-devel, glibc-devel, libicu-devel -Requires: libcurl, fontconfig, freetype, openssl, glibc libicu # Requirements not packaged in main repos # COPR @dotnet-sig/dotnet or # https://packages.microsoft.com/rhel/7/prod/ BuildRequires: dotnet-runtime-3.1, dotnet-sdk-3.1 -# RPMfusion free -Requires: ffmpeg - +Requires: %{name}-server = %{version}-%{release}, %{name}-web >= 1, %{name}-web < 2 # Disable Automatic Dependency Processing AutoReqProv: no %description Jellyfin is a free software media system that puts you in control of managing and streaming your media. +%package server +# RPMfusion free +Summary: The Free Software Media System Server backend +Requires(pre): shadow-utils +Requires: ffmpeg +Requires: libcurl, fontconfig, freetype, openssl, glibc libicu + +%description server +The Jellyfin media server backend. %prep %autosetup -n jellyfin-server-%{version} -b 0 @@ -69,7 +74,7 @@ EOF %{__install} -D -m 0755 %{SOURCE14} %{buildroot}%{_libexecdir}/jellyfin/restart.sh %{__install} -D -m 0644 %{SOURCE16} %{buildroot}%{_prefix}/lib/firewalld/services/jellyfin.xml -%files +%files server %attr(755,root,root) %{_bindir}/jellyfin %{_libdir}/jellyfin/*.json %{_libdir}/jellyfin/*.dll @@ -92,14 +97,14 @@ EOF %attr(750,jellyfin,jellyfin) %dir %{_var}/cache/jellyfin %{_datadir}/licenses/jellyfin/LICENSE -%pre +%pre server getent group jellyfin >/dev/null || groupadd -r jellyfin getent passwd jellyfin >/dev/null || \ useradd -r -g jellyfin -d %{_sharedstatedir}/jellyfin -s /sbin/nologin \ -c "Jellyfin default user" jellyfin exit 0 -%post +%post server # Move existing configuration cache and logs to their new locations and symlink them. if [ $1 -gt 1 ] ; then service_state=$(systemctl is-active jellyfin.service) @@ -127,10 +132,10 @@ if [ $1 -gt 1 ] ; then fi %systemd_post jellyfin.service -%preun +%preun server %systemd_preun jellyfin.service -%postun +%postun server %systemd_postun_with_restart jellyfin.service %changelog From c10df2fe85e06efb509a889bd7aae8ab5dc3a512 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 9 Apr 2020 11:33:22 -0400 Subject: [PATCH 044/115] Improve dpkg handling in build.sh --- build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 86c8447933..b4792a25ed 100755 --- a/build.sh +++ b/build.sh @@ -34,7 +34,7 @@ list_platforms() { } do_build_native() { - if [[ $( dpkg --print-architecture | head -1 ) != "${PLATFORM##*.}" ]]; then + if [[ -f $( which dpkg ) && $( dpkg --print-architecture | head -1 ) != "${PLATFORM##*.}" ]]; then echo "Cross-building is not supported for native builds, use 'docker' builds on amd64 for cross-building." exit 1 fi @@ -43,7 +43,7 @@ do_build_native() { } do_build_docker() { - if ! dpkg --print-architecture | grep -q 'amd64'; then + if [[ -f $( which dpkg ) && $( dpkg --print-architecture | head -1 ) != "amd64" ]]; then echo "Docker-based builds only support amd64-based cross-building; use a 'native' build instead." exit 1 fi From 529a9ae544dfd804466d852d3c9babf1a660a1eb Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 9 Apr 2020 11:37:00 -0400 Subject: [PATCH 045/115] Don't remove already-moved files --- bump_version | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bump_version b/bump_version index c868c541e6..46b7f86e05 100755 --- a/bump_version +++ b/bump_version @@ -67,8 +67,6 @@ echo -e "jellyfin (${new_version_deb}) unstable; urgency=medium cat ${debian_changelog_file} >> ${debian_changelog_temp} # Move into place mv ${debian_changelog_temp} ${debian_changelog_file} -# Clean up -rm -f ${debian_changelog_temp} # Write out a temporary Yum changelog with our new stuff prepended and some templated formatting fedora_spec_file="fedora/jellyfin.spec" @@ -95,7 +93,7 @@ popd # Move into place mv ${fedora_spec_temp} ${fedora_spec_file} # Clean up -rm -rf ${fedora_changelog_temp} ${fedora_spec_temp_dir} +rm -rf ${fedora_spec_temp_dir} # Stage the changed files for commit git add ${shared_version_file} ${build_file} ${debian_equivs_file} ${debian_changelog_file} ${fedora_spec_file} From b0e80b486b5a5047f78afd1f680b354daed94542 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 9 Apr 2020 11:40:04 -0400 Subject: [PATCH 046/115] Use jellyfin.org everywhere --- Emby.Notifications/NotificationEntryPoint.cs | 2 +- debian/control | 2 +- fedora/jellyfin.spec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Emby.Notifications/NotificationEntryPoint.cs b/Emby.Notifications/NotificationEntryPoint.cs index befecc570b..869b7407e2 100644 --- a/Emby.Notifications/NotificationEntryPoint.cs +++ b/Emby.Notifications/NotificationEntryPoint.cs @@ -143,7 +143,7 @@ namespace Emby.Notifications var notification = new NotificationRequest { - Description = "Please see jellyfin.media for details.", + Description = "Please see jellyfin.org for details.", NotificationType = type, Name = _localization.GetLocalizedString("NewVersionIsAvailable") }; diff --git a/debian/control b/debian/control index 648e28ae81..5559700cf5 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Build-Depends: debhelper (>= 9), libfreetype6-dev, libssl-dev Standards-Version: 3.9.4 -Homepage: https://jellyfin.media/ +Homepage: https://jellyfin.org/ Vcs-Git: https://github.org/jellyfin/jellyfin.git Vcs-Browser: https://github.org/jellyfin/jellyfin diff --git a/fedora/jellyfin.spec b/fedora/jellyfin.spec index 4071babcdc..4e1045d740 100644 --- a/fedora/jellyfin.spec +++ b/fedora/jellyfin.spec @@ -11,7 +11,7 @@ Version: 10.6.0 Release: 1%{?dist} Summary: The Free Software Media System License: GPLv3 -URL: https://jellyfin.media +URL: https://jellyfin.org # Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%{version}.tar.gz` Source0: jellyfin-server-%{version}.tar.gz Source11: jellyfin.service From 406d087a465dd62ad376124fcb53692b1f666aef Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 9 Apr 2020 11:46:16 -0400 Subject: [PATCH 047/115] Correct ARCH var in Ubuntu Dockerfiles --- deployment/Dockerfile.ubuntu.arm64 | 2 +- deployment/Dockerfile.ubuntu.armhf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/Dockerfile.ubuntu.arm64 b/deployment/Dockerfile.ubuntu.arm64 index e34ef7edd1..f91b91cd46 100644 --- a/deployment/Dockerfile.ubuntu.arm64 +++ b/deployment/Dockerfile.ubuntu.arm64 @@ -7,7 +7,7 @@ ARG SDK_VERSION=3.1 ENV SOURCE_DIR=/jellyfin ENV ARTIFACT_DIR=/dist ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=arm64 +ENV ARCH=amd64 ENV IS_DOCKER=YES # Prepare Debian build environment diff --git a/deployment/Dockerfile.ubuntu.armhf b/deployment/Dockerfile.ubuntu.armhf index 6f92c81ab1..85414614c0 100644 --- a/deployment/Dockerfile.ubuntu.armhf +++ b/deployment/Dockerfile.ubuntu.armhf @@ -7,7 +7,7 @@ ARG SDK_VERSION=3.1 ENV SOURCE_DIR=/jellyfin ENV ARTIFACT_DIR=/dist ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=armhf +ENV ARCH=amd64 ENV IS_DOCKER=YES # Prepare Debian build environment From ed735522cfd4ab8edfd7be2e4f6ce52856eb43cd Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 9 Apr 2020 11:49:14 -0400 Subject: [PATCH 048/115] Revert "Remove old stuff" This reverts commit b9fdd96ece39a6ff0f4ff37ecba36d7a0f65fcba. --- deployment/old/README.md | 62 ++++++ deployment/old/centos-package-x64/Dockerfile | 39 ++++ deployment/old/centos-package-x64/clean.sh | 32 ++++ .../old/centos-package-x64/dependencies.txt | 1 + .../old/centos-package-x64/docker-build.sh | 18 ++ deployment/old/centos-package-x64/package.sh | 34 ++++ deployment/old/centos-package-x64/pkg-src | 1 + .../old/debian-package-arm64/Dockerfile.amd64 | 43 +++++ .../old/debian-package-arm64/Dockerfile.arm64 | 34 ++++ deployment/old/debian-package-arm64/clean.sh | 27 +++ .../old/debian-package-arm64/dependencies.txt | 1 + .../old/debian-package-arm64/docker-build.sh | 21 ++ .../old/debian-package-arm64/package.sh | 45 +++++ deployment/old/debian-package-arm64/pkg-src | 1 + .../old/debian-package-armhf/Dockerfile.amd64 | 42 ++++ .../old/debian-package-armhf/Dockerfile.armhf | 34 ++++ deployment/old/debian-package-armhf/clean.sh | 27 +++ .../old/debian-package-armhf/dependencies.txt | 1 + .../old/debian-package-armhf/docker-build.sh | 21 ++ .../old/debian-package-armhf/package.sh | 45 +++++ deployment/old/debian-package-armhf/pkg-src | 1 + deployment/old/debian-package-x64/Dockerfile | 34 ++++ deployment/old/debian-package-x64/clean.sh | 27 +++ .../old/debian-package-x64/dependencies.txt | 1 + .../old/debian-package-x64/docker-build.sh | 20 ++ deployment/old/debian-package-x64/package.sh | 34 ++++ .../old/debian-package-x64/pkg-src/changelog | 59 ++++++ .../old/debian-package-x64/pkg-src/compat | 1 + .../debian-package-x64/pkg-src/conf/jellyfin | 40 ++++ .../pkg-src/conf/jellyfin-sudoers | 37 ++++ .../pkg-src/conf/jellyfin.service.conf | 7 + .../pkg-src/conf/logging.json | 30 +++ .../old/debian-package-x64/pkg-src/control | 31 +++ .../old/debian-package-x64/pkg-src/copyright | 29 +++ .../old/debian-package-x64/pkg-src/gbp.conf | 6 + .../old/debian-package-x64/pkg-src/install | 6 + .../debian-package-x64/pkg-src/jellyfin.init | 61 ++++++ .../pkg-src/jellyfin.service | 14 ++ .../pkg-src/jellyfin.upstart | 20 ++ .../debian-package-x64/pkg-src/po/POTFILES.in | 1 + .../pkg-src/po/templates.pot | 57 ++++++ .../old/debian-package-x64/pkg-src/postinst | 92 +++++++++ .../old/debian-package-x64/pkg-src/postrm | 81 ++++++++ .../old/debian-package-x64/pkg-src/preinst | 78 ++++++++ .../old/debian-package-x64/pkg-src/prerm | 61 ++++++ .../old/debian-package-x64/pkg-src/rules | 66 +++++++ .../pkg-src/source.lintian-overrides | 3 + .../debian-package-x64/pkg-src/source/format | 1 + .../debian-package-x64/pkg-src/source/options | 11 ++ deployment/old/fedora-package-x64/Dockerfile | 33 ++++ deployment/old/fedora-package-x64/clean.sh | 32 ++++ .../old/fedora-package-x64/dependencies.txt | 1 + .../old/fedora-package-x64/docker-build.sh | 18 ++ deployment/old/fedora-package-x64/package.sh | 34 ++++ .../old/fedora-package-x64/pkg-src/.gitignore | 3 + .../old/fedora-package-x64/pkg-src/README.md | 43 +++++ .../pkg-src/jellyfin-firewalld.xml | 9 + .../fedora-package-x64/pkg-src/jellyfin.env | 34 ++++ .../pkg-src/jellyfin.override.conf | 7 + .../pkg-src/jellyfin.service | 15 ++ .../fedora-package-x64/pkg-src/jellyfin.spec | 181 ++++++++++++++++++ .../pkg-src/jellyfin.sudoers | 19 ++ .../old/fedora-package-x64/pkg-src/restart.sh | 36 ++++ deployment/old/linux-x64/Dockerfile | 37 ++++ deployment/old/linux-x64/clean.sh | 27 +++ deployment/old/linux-x64/dependencies.txt | 1 + deployment/old/linux-x64/docker-build.sh | 36 ++++ deployment/old/linux-x64/package.sh | 34 ++++ deployment/old/macos/Dockerfile | 37 ++++ deployment/old/macos/clean.sh | 27 +++ deployment/old/macos/dependencies.txt | 1 + deployment/old/macos/docker-build.sh | 36 ++++ deployment/old/macos/package.sh | 34 ++++ deployment/old/portable/Dockerfile | 37 ++++ deployment/old/portable/clean.sh | 27 +++ deployment/old/portable/dependencies.txt | 1 + deployment/old/portable/docker-build.sh | 36 ++++ deployment/old/portable/package.sh | 34 ++++ .../old/ubuntu-package-arm64/Dockerfile.amd64 | 59 ++++++ .../old/ubuntu-package-arm64/Dockerfile.arm64 | 40 ++++ deployment/old/ubuntu-package-arm64/clean.sh | 27 +++ .../old/ubuntu-package-arm64/dependencies.txt | 1 + .../old/ubuntu-package-arm64/docker-build.sh | 21 ++ .../old/ubuntu-package-arm64/package.sh | 45 +++++ deployment/old/ubuntu-package-arm64/pkg-src | 1 + .../old/ubuntu-package-armhf/Dockerfile.amd64 | 59 ++++++ .../old/ubuntu-package-armhf/Dockerfile.armhf | 40 ++++ deployment/old/ubuntu-package-armhf/clean.sh | 27 +++ .../old/ubuntu-package-armhf/dependencies.txt | 1 + .../old/ubuntu-package-armhf/docker-build.sh | 21 ++ .../old/ubuntu-package-armhf/package.sh | 45 +++++ deployment/old/ubuntu-package-armhf/pkg-src | 1 + deployment/old/ubuntu-package-x64/Dockerfile | 36 ++++ deployment/old/ubuntu-package-x64/clean.sh | 27 +++ .../old/ubuntu-package-x64/dependencies.txt | 1 + .../old/ubuntu-package-x64/docker-build.sh | 20 ++ deployment/old/ubuntu-package-x64/package.sh | 34 ++++ deployment/old/ubuntu-package-x64/pkg-src | 1 + .../old/unraid/docker-templates/README.md | 15 ++ .../old/unraid/docker-templates/jellyfin.xml | 57 ++++++ deployment/old/win-x64/Dockerfile | 37 ++++ deployment/old/win-x64/clean.sh | 27 +++ deployment/old/win-x64/dependencies.txt | 1 + deployment/old/win-x64/docker-build.sh | 61 ++++++ deployment/old/win-x64/package.sh | 34 ++++ deployment/old/win-x86/Dockerfile | 37 ++++ deployment/old/win-x86/clean.sh | 27 +++ deployment/old/win-x86/dependencies.txt | 1 + deployment/old/win-x86/docker-build.sh | 61 ++++++ deployment/old/win-x86/package.sh | 34 ++++ 110 files changed, 3207 insertions(+) create mode 100644 deployment/old/README.md create mode 100644 deployment/old/centos-package-x64/Dockerfile create mode 100755 deployment/old/centos-package-x64/clean.sh create mode 100644 deployment/old/centos-package-x64/dependencies.txt create mode 100755 deployment/old/centos-package-x64/docker-build.sh create mode 100755 deployment/old/centos-package-x64/package.sh create mode 120000 deployment/old/centos-package-x64/pkg-src create mode 100644 deployment/old/debian-package-arm64/Dockerfile.amd64 create mode 100644 deployment/old/debian-package-arm64/Dockerfile.arm64 create mode 100755 deployment/old/debian-package-arm64/clean.sh create mode 100644 deployment/old/debian-package-arm64/dependencies.txt create mode 100755 deployment/old/debian-package-arm64/docker-build.sh create mode 100755 deployment/old/debian-package-arm64/package.sh create mode 120000 deployment/old/debian-package-arm64/pkg-src create mode 100644 deployment/old/debian-package-armhf/Dockerfile.amd64 create mode 100644 deployment/old/debian-package-armhf/Dockerfile.armhf create mode 100755 deployment/old/debian-package-armhf/clean.sh create mode 100644 deployment/old/debian-package-armhf/dependencies.txt create mode 100755 deployment/old/debian-package-armhf/docker-build.sh create mode 100755 deployment/old/debian-package-armhf/package.sh create mode 120000 deployment/old/debian-package-armhf/pkg-src create mode 100644 deployment/old/debian-package-x64/Dockerfile create mode 100755 deployment/old/debian-package-x64/clean.sh create mode 100644 deployment/old/debian-package-x64/dependencies.txt create mode 100755 deployment/old/debian-package-x64/docker-build.sh create mode 100755 deployment/old/debian-package-x64/package.sh create mode 100644 deployment/old/debian-package-x64/pkg-src/changelog create mode 100644 deployment/old/debian-package-x64/pkg-src/compat create mode 100644 deployment/old/debian-package-x64/pkg-src/conf/jellyfin create mode 100644 deployment/old/debian-package-x64/pkg-src/conf/jellyfin-sudoers create mode 100644 deployment/old/debian-package-x64/pkg-src/conf/jellyfin.service.conf create mode 100644 deployment/old/debian-package-x64/pkg-src/conf/logging.json create mode 100644 deployment/old/debian-package-x64/pkg-src/control create mode 100644 deployment/old/debian-package-x64/pkg-src/copyright create mode 100644 deployment/old/debian-package-x64/pkg-src/gbp.conf create mode 100644 deployment/old/debian-package-x64/pkg-src/install create mode 100644 deployment/old/debian-package-x64/pkg-src/jellyfin.init create mode 100644 deployment/old/debian-package-x64/pkg-src/jellyfin.service create mode 100644 deployment/old/debian-package-x64/pkg-src/jellyfin.upstart create mode 100644 deployment/old/debian-package-x64/pkg-src/po/POTFILES.in create mode 100644 deployment/old/debian-package-x64/pkg-src/po/templates.pot create mode 100644 deployment/old/debian-package-x64/pkg-src/postinst create mode 100644 deployment/old/debian-package-x64/pkg-src/postrm create mode 100644 deployment/old/debian-package-x64/pkg-src/preinst create mode 100644 deployment/old/debian-package-x64/pkg-src/prerm create mode 100755 deployment/old/debian-package-x64/pkg-src/rules create mode 100644 deployment/old/debian-package-x64/pkg-src/source.lintian-overrides create mode 100644 deployment/old/debian-package-x64/pkg-src/source/format create mode 100644 deployment/old/debian-package-x64/pkg-src/source/options create mode 100644 deployment/old/fedora-package-x64/Dockerfile create mode 100755 deployment/old/fedora-package-x64/clean.sh create mode 100644 deployment/old/fedora-package-x64/dependencies.txt create mode 100755 deployment/old/fedora-package-x64/docker-build.sh create mode 100755 deployment/old/fedora-package-x64/package.sh create mode 100644 deployment/old/fedora-package-x64/pkg-src/.gitignore create mode 100644 deployment/old/fedora-package-x64/pkg-src/README.md create mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin-firewalld.xml create mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin.env create mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin.override.conf create mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin.service create mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin.spec create mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin.sudoers create mode 100755 deployment/old/fedora-package-x64/pkg-src/restart.sh create mode 100644 deployment/old/linux-x64/Dockerfile create mode 100755 deployment/old/linux-x64/clean.sh create mode 100644 deployment/old/linux-x64/dependencies.txt create mode 100755 deployment/old/linux-x64/docker-build.sh create mode 100755 deployment/old/linux-x64/package.sh create mode 100644 deployment/old/macos/Dockerfile create mode 100755 deployment/old/macos/clean.sh create mode 100644 deployment/old/macos/dependencies.txt create mode 100755 deployment/old/macos/docker-build.sh create mode 100755 deployment/old/macos/package.sh create mode 100644 deployment/old/portable/Dockerfile create mode 100755 deployment/old/portable/clean.sh create mode 100644 deployment/old/portable/dependencies.txt create mode 100755 deployment/old/portable/docker-build.sh create mode 100755 deployment/old/portable/package.sh create mode 100644 deployment/old/ubuntu-package-arm64/Dockerfile.amd64 create mode 100644 deployment/old/ubuntu-package-arm64/Dockerfile.arm64 create mode 100755 deployment/old/ubuntu-package-arm64/clean.sh create mode 100644 deployment/old/ubuntu-package-arm64/dependencies.txt create mode 100755 deployment/old/ubuntu-package-arm64/docker-build.sh create mode 100755 deployment/old/ubuntu-package-arm64/package.sh create mode 120000 deployment/old/ubuntu-package-arm64/pkg-src create mode 100644 deployment/old/ubuntu-package-armhf/Dockerfile.amd64 create mode 100644 deployment/old/ubuntu-package-armhf/Dockerfile.armhf create mode 100755 deployment/old/ubuntu-package-armhf/clean.sh create mode 100644 deployment/old/ubuntu-package-armhf/dependencies.txt create mode 100755 deployment/old/ubuntu-package-armhf/docker-build.sh create mode 100755 deployment/old/ubuntu-package-armhf/package.sh create mode 120000 deployment/old/ubuntu-package-armhf/pkg-src create mode 100644 deployment/old/ubuntu-package-x64/Dockerfile create mode 100755 deployment/old/ubuntu-package-x64/clean.sh create mode 100644 deployment/old/ubuntu-package-x64/dependencies.txt create mode 100755 deployment/old/ubuntu-package-x64/docker-build.sh create mode 100755 deployment/old/ubuntu-package-x64/package.sh create mode 120000 deployment/old/ubuntu-package-x64/pkg-src create mode 100644 deployment/old/unraid/docker-templates/README.md create mode 100644 deployment/old/unraid/docker-templates/jellyfin.xml create mode 100644 deployment/old/win-x64/Dockerfile create mode 100755 deployment/old/win-x64/clean.sh create mode 100644 deployment/old/win-x64/dependencies.txt create mode 100755 deployment/old/win-x64/docker-build.sh create mode 100755 deployment/old/win-x64/package.sh create mode 100644 deployment/old/win-x86/Dockerfile create mode 100755 deployment/old/win-x86/clean.sh create mode 100644 deployment/old/win-x86/dependencies.txt create mode 100755 deployment/old/win-x86/docker-build.sh create mode 100755 deployment/old/win-x86/package.sh diff --git a/deployment/old/README.md b/deployment/old/README.md new file mode 100644 index 0000000000..a805f59ca3 --- /dev/null +++ b/deployment/old/README.md @@ -0,0 +1,62 @@ +# Jellyfin Packaging + +This directory contains the packaging configuration of Jellyfin for multiple platforms. The specification is below; all package platforms must follow the specification to be compatable with the central `build` script. + +## Package List + +### Operating System Packages + +* `debian-package-x64`: Package for Debian and Ubuntu amd64 systems. +* `fedora-package-x64`: Package for Fedora, CentOS, and Red Hat Enterprise Linux amd64 systems. + +### Portable Builds (archives) + +* `linux-x64`: Portable binary archive for generic Linux amd64 systems. +* `macos`: Portable binary archive for MacOS amd64 systems. +* `win-x64`: Portable binary archive for Windows amd64 systems. +* `win-x86`: Portable binary archive for Windows i386 systems. + +### Other Builds + +These builds are not necessarily run from the `build` script, but are present for other platforms. + +* `portable`: Compiled `.dll` for use with .NET Core runtime on any system. +* `docker`: Docker manifests for auto-publishing. +* `unraid`: unRaid Docker template; not built by `build` but imported into unRaid directly. +* `windows`: Support files and scripts for Windows CI build. + +## Package Specification + +### Dependencies + +* If a platform requires additional build dependencies, the required binary names, i.e. to validate `which `, should be specified in a `dependencies.txt` file inside the platform directory. + +* Each dependency should be present on its own line. + +### Action Scripts + +* Actions are defined in BASH scripts with the name `.sh` within the platform directory. + +* The list of valid actions are: + + 1. `build`: Builds a set of binaries. + 2. `package`: Assembles the compiled binaries into a package. + 3. `sign`: Performs signing actions on a package. + 4. `publish`: Performs a publishing action for a package. + 5. `clean`: Cleans up any artifacts from the previous actions. + +* All package actions are optional, however at least one should generate output files, and any that do should contain a `clean` action. + +* Actions are executed in the order specified above, and later actions may depend on former actions. + +* Actions except for `clean` should `set -o errexit` to terminate on failed actions. + +* The `clean` action should always `exit 0` even if no work is done or it fails. + +* The `clean` action can be passed a variable as argument 1, named `keep_artifacts`, containing either the value `y` or `n`. It is indended to handle situations when the user runs `build --keep-artifacts` and should be handled intelligently. Usually, this is used to preserve Docker images while still removing temporary directories. + +### Output Files + +* Upon completion of the defined actions, at least one output file must be created in the `/pkg-dist` directory. + +* Output files will be moved to the directory `jellyfin-build/` one directory above the repository root upon completion. diff --git a/deployment/old/centos-package-x64/Dockerfile b/deployment/old/centos-package-x64/Dockerfile new file mode 100644 index 0000000000..08219a2e4a --- /dev/null +++ b/deployment/old/centos-package-x64/Dockerfile @@ -0,0 +1,39 @@ +FROM centos:7 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/centos-package-x64 +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist + +# Prepare CentOS environment +RUN yum update -y \ + && yum install -y epel-release + +# Install build dependencies +RUN yum install -y @buildsys-build rpmdevtools yum-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel git + +# Install recent NodeJS and Yarn +RUN curl -fSsLo /etc/yum.repos.d/yarn.repo https://dl.yarnpkg.com/rpm/yarn.repo \ + && rpm -i https://rpm.nodesource.com/pub_10.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm \ + && yum install -y yarn + +# Install DotNET SDK +RUN rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm \ + && rpmdev-setuptree \ + && yum install -y dotnet-sdk-${SDK_VERSION} + +# Create symlinks and directories +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh \ + && mkdir -p ${SOURCE_DIR}/SPECS \ + && ln -s ${PLATFORM_DIR}/pkg-src/jellyfin.spec ${SOURCE_DIR}/SPECS/jellyfin.spec \ + && mkdir -p ${SOURCE_DIR}/SOURCES \ + && ln -s ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/SOURCES + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/centos-package-x64/clean.sh b/deployment/old/centos-package-x64/clean.sh new file mode 100755 index 0000000000..31455de0d4 --- /dev/null +++ b/deployment/old/centos-package-x64/clean.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +keep_artifacts="${1}" + +WORKDIR="$( pwd )" +VERSION="$( grep -A1 '^Version:' ${WORKDIR}/pkg-src/jellyfin.spec | awk '{ print $NF }' )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +package_source_dir="${WORKDIR}/pkg-src" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-centos-build" + +rm -f "${package_source_dir}/jellyfin-${VERSION}.tar.gz" &>/dev/null \ + || sudo rm -f "${package_source_dir}/jellyfin-${VERSION}.tar.gz" &>/dev/null + +rm -rf "${package_temporary_dir}" &>/dev/null \ + || sudo rm -rf "${package_temporary_dir}" &>/dev/null + +rm -rf "${output_dir}" &>/dev/null \ + || sudo rm -rf "${output_dir}" &>/dev/null + +if [[ ${keep_artifacts} == 'n' ]]; then + docker_sudo="" + if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo=sudo + fi + ${docker_sudo} docker image rm ${image_name} --force +fi diff --git a/deployment/old/centos-package-x64/dependencies.txt b/deployment/old/centos-package-x64/dependencies.txt new file mode 100644 index 0000000000..bdb9670965 --- /dev/null +++ b/deployment/old/centos-package-x64/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/old/centos-package-x64/docker-build.sh b/deployment/old/centos-package-x64/docker-build.sh new file mode 100755 index 0000000000..62dd144e50 --- /dev/null +++ b/deployment/old/centos-package-x64/docker-build.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Builds the RPM inside the Docker container + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Build RPM +make -f .copr/Makefile srpm outdir=/root/rpmbuild/SRPMS +rpmbuild --rebuild -bb /root/rpmbuild/SRPMS/jellyfin-*.src.rpm + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/rpm +mv /root/rpmbuild/RPMS/x86_64/jellyfin-*.rpm /root/rpmbuild/SRPMS/jellyfin-*.src.rpm ${ARTIFACT_DIR}/rpm/ +chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/centos-package-x64/package.sh b/deployment/old/centos-package-x64/package.sh new file mode 100755 index 0000000000..1b983f49d9 --- /dev/null +++ b/deployment/old/centos-package-x64/package.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +args="${@}" +declare -a docker_envvars +for arg in ${args}; do + docker_envvars+=("-e ${arg}") +done + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-centos-build" + +# Determine if sudo should be used for Docker +if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo="sudo" +else + docker_sudo="" +fi + +# Prepare temporary package dir +mkdir -p "${package_temporary_dir}" +# Set up the build environment Docker image +${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile +# Build the RPMs and copy out to ${package_temporary_dir} +${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} +# Move the RPMs to the output directory +mkdir -p "${output_dir}" +mv "${package_temporary_dir}"/rpm/* "${output_dir}" diff --git a/deployment/old/centos-package-x64/pkg-src b/deployment/old/centos-package-x64/pkg-src new file mode 120000 index 0000000000..3ff4d3cbf5 --- /dev/null +++ b/deployment/old/centos-package-x64/pkg-src @@ -0,0 +1 @@ +../fedora-package-x64/pkg-src/ \ No newline at end of file diff --git a/deployment/old/debian-package-arm64/Dockerfile.amd64 b/deployment/old/debian-package-arm64/Dockerfile.amd64 new file mode 100644 index 0000000000..b63e08b7dd --- /dev/null +++ b/deployment/old/debian-package-arm64/Dockerfile.amd64 @@ -0,0 +1,43 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-arm64 +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Prepare the cross-toolchain +RUN dpkg --add-architecture arm64 \ + && apt-get update \ + && apt-get install -y cross-gcc-dev \ + && TARGET_LIST="arm64" cross-gcc-gensource 8 \ + && cd cross-gcc-packages-amd64/cross-gcc-8-arm64 \ + && apt-get install -y gcc-8-source libstdc++-8-dev-arm64-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:arm64 linux-libc-dev:arm64 libgcc1:arm64 libcurl4-openssl-dev:arm64 libfontconfig1-dev:arm64 libfreetype6-dev:arm64 libssl-dev:arm64 liblttng-ust0:arm64 libstdc++-8-dev:arm64 + +# Link to docker-build script +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh + +# Link to Debian source dir; mkdir needed or it fails, can't force dest +RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] +#ENTRYPOINT ["/bin/bash"] diff --git a/deployment/old/debian-package-arm64/Dockerfile.arm64 b/deployment/old/debian-package-arm64/Dockerfile.arm64 new file mode 100644 index 0000000000..9ca4868441 --- /dev/null +++ b/deployment/old/debian-package-arm64/Dockerfile.arm64 @@ -0,0 +1,34 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-arm64 +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=arm64 + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev liblttng-ust0 + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/5a4c8f96-1c73-401c-a6de-8e100403188a/0ce6ab39747e2508366d498f9c0a0669/dotnet-sdk-3.1.100-linux-arm64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Link to docker-build script +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh + +# Link to Debian source dir; mkdir needed or it fails, can't force dest +RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/debian-package-arm64/clean.sh b/deployment/old/debian-package-arm64/clean.sh new file mode 100755 index 0000000000..e7bfdf8b4b --- /dev/null +++ b/deployment/old/debian-package-arm64/clean.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +keep_artifacts="${1}" + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-debian_arm64-build" + +rm -rf "${package_temporary_dir}" &>/dev/null \ + || sudo rm -rf "${package_temporary_dir}" &>/dev/null + +rm -rf "${output_dir}" &>/dev/null \ + || sudo rm -rf "${output_dir}" &>/dev/null + +if [[ ${keep_artifacts} == 'n' ]]; then + docker_sudo="" + if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo=sudo + fi + ${docker_sudo} docker image rm ${image_name} --force +fi diff --git a/deployment/old/debian-package-arm64/dependencies.txt b/deployment/old/debian-package-arm64/dependencies.txt new file mode 100644 index 0000000000..bdb9670965 --- /dev/null +++ b/deployment/old/debian-package-arm64/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/old/debian-package-arm64/docker-build.sh b/deployment/old/debian-package-arm64/docker-build.sh new file mode 100755 index 0000000000..67ab6bd74b --- /dev/null +++ b/deployment/old/debian-package-arm64/docker-build.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Builds the DEB inside the Docker container + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image +sed -i '/dotnet-sdk-3.1,/d' debian/control + +# Build DEB +export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} +dpkg-buildpackage -us -uc -aarm64 + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/deb +mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ +chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/debian-package-arm64/package.sh b/deployment/old/debian-package-arm64/package.sh new file mode 100755 index 0000000000..2091982187 --- /dev/null +++ b/deployment/old/debian-package-arm64/package.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +args="${@}" +declare -a docker_envvars +for arg in ${args}; do + docker_envvars+=("-e ${arg}") +done + +ARCH="$( arch )" +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-debian_arm64-build" + +# Determine if sudo should be used for Docker +if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo="sudo" +else + docker_sudo="" +fi + +# Determine which Dockerfile to use +case $ARCH in + 'x86_64') + DOCKERFILE="Dockerfile.amd64" + ;; + 'armv7l') + DOCKERFILE="Dockerfile.arm64" + ;; +esac + +# Prepare temporary package dir +mkdir -p "${package_temporary_dir}" +# Set up the build environment Docker image +${docker_sudo} docker build ../.. -t "${image_name}" -f ./${DOCKERFILE} +# Build the DEBs and copy out to ${package_temporary_dir} +${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} +# Move the DEBs to the output directory +mkdir -p "${output_dir}" +mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/debian-package-arm64/pkg-src b/deployment/old/debian-package-arm64/pkg-src new file mode 120000 index 0000000000..4c695fea17 --- /dev/null +++ b/deployment/old/debian-package-arm64/pkg-src @@ -0,0 +1 @@ +../debian-package-x64/pkg-src \ No newline at end of file diff --git a/deployment/old/debian-package-armhf/Dockerfile.amd64 b/deployment/old/debian-package-armhf/Dockerfile.amd64 new file mode 100644 index 0000000000..1b64b53148 --- /dev/null +++ b/deployment/old/debian-package-armhf/Dockerfile.amd64 @@ -0,0 +1,42 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-armhf +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Prepare the cross-toolchain +RUN dpkg --add-architecture armhf \ + && apt-get update \ + && apt-get install -y cross-gcc-dev \ + && TARGET_LIST="armhf" cross-gcc-gensource 8 \ + && cd cross-gcc-packages-amd64/cross-gcc-8-armhf \ + && apt-get install -y gcc-8-source libstdc++-8-dev-armhf-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip binutils-arm-linux-gnueabihf libc6-dev:armhf linux-libc-dev:armhf libgcc1:armhf libcurl4-openssl-dev:armhf libfontconfig1-dev:armhf libfreetype6-dev:armhf libssl-dev:armhf liblttng-ust0:armhf libstdc++-8-dev:armhf + +# Link to docker-build script +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh + +# Link to Debian source dir; mkdir needed or it fails, can't force dest +RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/debian-package-armhf/Dockerfile.armhf b/deployment/old/debian-package-armhf/Dockerfile.armhf new file mode 100644 index 0000000000..dd398b5aa5 --- /dev/null +++ b/deployment/old/debian-package-armhf/Dockerfile.armhf @@ -0,0 +1,34 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-armhf +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=armhf + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev liblttng-ust0 + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/67766a96-eb8c-4cd2-bca4-ea63d2cc115c/7bf13840aa2ed88793b7315d5e0d74e6/dotnet-sdk-3.1.100-linux-arm.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Link to docker-build script +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh + +# Link to Debian source dir; mkdir needed or it fails, can't force dest +RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/debian-package-armhf/clean.sh b/deployment/old/debian-package-armhf/clean.sh new file mode 100755 index 0000000000..35a3d3e9ad --- /dev/null +++ b/deployment/old/debian-package-armhf/clean.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +keep_artifacts="${1}" + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-debian_armhf-build" + +rm -rf "${package_temporary_dir}" &>/dev/null \ + || sudo rm -rf "${package_temporary_dir}" &>/dev/null + +rm -rf "${output_dir}" &>/dev/null \ + || sudo rm -rf "${output_dir}" &>/dev/null + +if [[ ${keep_artifacts} == 'n' ]]; then + docker_sudo="" + if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo=sudo + fi + ${docker_sudo} docker image rm ${image_name} --force +fi diff --git a/deployment/old/debian-package-armhf/dependencies.txt b/deployment/old/debian-package-armhf/dependencies.txt new file mode 100644 index 0000000000..bdb9670965 --- /dev/null +++ b/deployment/old/debian-package-armhf/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/old/debian-package-armhf/docker-build.sh b/deployment/old/debian-package-armhf/docker-build.sh new file mode 100755 index 0000000000..1bd7fb2911 --- /dev/null +++ b/deployment/old/debian-package-armhf/docker-build.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Builds the DEB inside the Docker container + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image +sed -i '/dotnet-sdk-3.1,/d' debian/control + +# Build DEB +export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} +dpkg-buildpackage -us -uc -aarmhf + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/deb +mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ +chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/debian-package-armhf/package.sh b/deployment/old/debian-package-armhf/package.sh new file mode 100755 index 0000000000..4a27dd8283 --- /dev/null +++ b/deployment/old/debian-package-armhf/package.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +args="${@}" +declare -a docker_envvars +for arg in ${args}; do + docker_envvars+=("-e ${arg}") +done + +ARCH="$( arch )" +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-debian_armhf-build" + +# Determine if sudo should be used for Docker +if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo="sudo" +else + docker_sudo="" +fi + +# Determine which Dockerfile to use +case $ARCH in + 'x86_64') + DOCKERFILE="Dockerfile.amd64" + ;; + 'armv7l') + DOCKERFILE="Dockerfile.armhf" + ;; +esac + +# Prepare temporary package dir +mkdir -p "${package_temporary_dir}" +# Set up the build environment Docker image +${docker_sudo} docker build ../.. -t "${image_name}" -f ./${DOCKERFILE} +# Build the DEBs and copy out to ${package_temporary_dir} +${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} +# Move the DEBs to the output directory +mkdir -p "${output_dir}" +mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/debian-package-armhf/pkg-src b/deployment/old/debian-package-armhf/pkg-src new file mode 120000 index 0000000000..0bb6d55249 --- /dev/null +++ b/deployment/old/debian-package-armhf/pkg-src @@ -0,0 +1 @@ +../debian-package-x64/pkg-src/ \ No newline at end of file diff --git a/deployment/old/debian-package-x64/Dockerfile b/deployment/old/debian-package-x64/Dockerfile new file mode 100644 index 0000000000..e863d1edf9 --- /dev/null +++ b/deployment/old/debian-package-x64/Dockerfile @@ -0,0 +1,34 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-x64 +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Link to docker-build script +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh + +# Link to Debian source dir; mkdir needed or it fails, can't force dest +RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/debian-package-x64/clean.sh b/deployment/old/debian-package-x64/clean.sh new file mode 100755 index 0000000000..4e507bcb27 --- /dev/null +++ b/deployment/old/debian-package-x64/clean.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +keep_artifacts="${1}" + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-debian-build" + +rm -rf "${package_temporary_dir}" &>/dev/null \ + || sudo rm -rf "${package_temporary_dir}" &>/dev/null + +rm -rf "${output_dir}" &>/dev/null \ + || sudo rm -rf "${output_dir}" &>/dev/null + +if [[ ${keep_artifacts} == 'n' ]]; then + docker_sudo="" + if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo=sudo + fi + ${docker_sudo} docker image rm ${image_name} --force +fi diff --git a/deployment/old/debian-package-x64/dependencies.txt b/deployment/old/debian-package-x64/dependencies.txt new file mode 100644 index 0000000000..bdb9670965 --- /dev/null +++ b/deployment/old/debian-package-x64/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/old/debian-package-x64/docker-build.sh b/deployment/old/debian-package-x64/docker-build.sh new file mode 100755 index 0000000000..962a522ebc --- /dev/null +++ b/deployment/old/debian-package-x64/docker-build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Builds the DEB inside the Docker container + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image +sed -i '/dotnet-sdk-3.1,/d' debian/control + +# Build DEB +dpkg-buildpackage -us -uc + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/deb +mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ +chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/debian-package-x64/package.sh b/deployment/old/debian-package-x64/package.sh new file mode 100755 index 0000000000..5a416959ab --- /dev/null +++ b/deployment/old/debian-package-x64/package.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +args="${@}" +declare -a docker_envvars +for arg in ${args}; do + docker_envvars+=("-e ${arg}") +done + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-debian-build" + +# Determine if sudo should be used for Docker +if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo="sudo" +else + docker_sudo="" +fi + +# Prepare temporary package dir +mkdir -p "${package_temporary_dir}" +# Set up the build environment Docker image +${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile +# Build the DEBs and copy out to ${package_temporary_dir} +${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} +# Move the DEBs to the output directory +mkdir -p "${output_dir}" +mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/debian-package-x64/pkg-src/changelog b/deployment/old/debian-package-x64/pkg-src/changelog new file mode 100644 index 0000000000..51c4822370 --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/changelog @@ -0,0 +1,59 @@ +jellyfin (10.5.0-1) unstable; urgency=medium + + * New upstream version 10.5.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.5.0 + + -- Jellyfin Packaging Team Fri, 11 Oct 2019 20:12:38 -0400 + +jellyfin (10.4.0-1) unstable; urgency=medium + + * New upstream version 10.4.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.4.0 + + -- Jellyfin Packaging Team Sat, 31 Aug 2019 21:38:56 -0400 + +jellyfin (10.3.7-1) unstable; urgency=medium + + * New upstream version 10.3.7; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.7 + + -- Jellyfin Packaging Team Wed, 24 Jul 2019 10:48:28 -0400 + +jellyfin (10.3.6-1) unstable; urgency=medium + + * New upstream version 10.3.6; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.6 + + -- Jellyfin Packaging Team Sat, 06 Jul 2019 13:34:19 -0400 + +jellyfin (10.3.5-1) unstable; urgency=medium + + * New upstream version 10.3.5; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.5 + + -- Jellyfin Packaging Team Sun, 09 Jun 2019 21:47:35 -0400 + +jellyfin (10.3.4-1) unstable; urgency=medium + + * New upstream version 10.3.4; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.4 + + -- Jellyfin Packaging Team Thu, 06 Jun 2019 22:45:31 -0400 + +jellyfin (10.3.3-1) unstable; urgency=medium + + * New upstream version 10.3.3; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.3 + + -- Jellyfin Packaging Team Fri, 17 May 2019 23:12:08 -0400 + +jellyfin (10.3.2-1) unstable; urgency=medium + + * New upstream version 10.3.2; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.2 + + -- Jellyfin Packaging Team Tue, 30 Apr 2019 20:18:44 -0400 + +jellyfin (10.3.1-1) unstable; urgency=medium + + * New upstream version 10.3.1; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.1 + + -- Jellyfin Packaging Team Sat, 20 Apr 2019 14:24:07 -0400 + +jellyfin (10.3.0-1) unstable; urgency=medium + + * New upstream version 10.3.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.0 + + -- Jellyfin Packaging Team Fri, 19 Apr 2019 14:24:29 -0400 diff --git a/deployment/old/debian-package-x64/pkg-src/compat b/deployment/old/debian-package-x64/pkg-src/compat new file mode 100644 index 0000000000..45a4fb75db --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/compat @@ -0,0 +1 @@ +8 diff --git a/deployment/old/debian-package-x64/pkg-src/conf/jellyfin b/deployment/old/debian-package-x64/pkg-src/conf/jellyfin new file mode 100644 index 0000000000..c6e595f15a --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/conf/jellyfin @@ -0,0 +1,40 @@ +# Jellyfin default configuration options +# This is a POSIX shell fragment + +# Use this file to override the default configurations; add additional +# options with JELLYFIN_ADD_OPTS. + +# Under systemd, use +# /etc/systemd/system/jellyfin.service.d/jellyfin.service.conf +# to override the user or this config file's location. + +# +# General options +# + +# Program directories +JELLYFIN_DATA_DIR="/var/lib/jellyfin" +JELLYFIN_CONFIG_DIR="/etc/jellyfin" +JELLYFIN_LOG_DIR="/var/log/jellyfin" +JELLYFIN_CACHE_DIR="/var/cache/jellyfin" + +# Restart script for in-app server control +JELLYFIN_RESTART_OPT="--restartpath=/usr/lib/jellyfin/restart.sh" + +# ffmpeg binary paths, overriding the system values +JELLYFIN_FFMPEG_OPT="--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg" + +# [OPTIONAL] run Jellyfin as a headless service +#JELLYFIN_SERVICE_OPT="--service" + +# [OPTIONAL] run Jellyfin without the web app +#JELLYFIN_NOWEBAPP_OPT="--noautorunwebapp" + +# +# SysV init/Upstart options +# + +# Application username +JELLYFIN_USER="jellyfin" +# Full application command +JELLYFIN_ARGS="$JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLFIN_NOWEBAPP_OPT" diff --git a/deployment/old/debian-package-x64/pkg-src/conf/jellyfin-sudoers b/deployment/old/debian-package-x64/pkg-src/conf/jellyfin-sudoers new file mode 100644 index 0000000000..b481ba4ad4 --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/conf/jellyfin-sudoers @@ -0,0 +1,37 @@ +#Allow jellyfin group to start, stop and restart itself +Cmnd_Alias RESTARTSERVER_SYSV = /sbin/service jellyfin restart, /usr/sbin/service jellyfin restart +Cmnd_Alias STARTSERVER_SYSV = /sbin/service jellyfin start, /usr/sbin/service jellyfin start +Cmnd_Alias STOPSERVER_SYSV = /sbin/service jellyfin stop, /usr/sbin/service jellyfin stop +Cmnd_Alias RESTARTSERVER_SYSTEMD = /usr/bin/systemctl restart jellyfin, /bin/systemctl restart jellyfin +Cmnd_Alias STARTSERVER_SYSTEMD = /usr/bin/systemctl start jellyfin, /bin/systemctl start jellyfin +Cmnd_Alias STOPSERVER_SYSTEMD = /usr/bin/systemctl stop jellyfin, /bin/systemctl stop jellyfin +Cmnd_Alias RESTARTSERVER_INITD = /etc/init.d/jellyfin restart +Cmnd_Alias STARTSERVER_INITD = /etc/init.d/jellyfin start +Cmnd_Alias STOPSERVER_INITD = /etc/init.d/jellyfin stop + + +jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSV +jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSV +jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSV +jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSTEMD +jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSTEMD +jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSTEMD +jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_INITD +jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_INITD +jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_INITD + +Defaults!RESTARTSERVER_SYSV !requiretty +Defaults!STARTSERVER_SYSV !requiretty +Defaults!STOPSERVER_SYSV !requiretty +Defaults!RESTARTSERVER_SYSTEMD !requiretty +Defaults!STARTSERVER_SYSTEMD !requiretty +Defaults!STOPSERVER_SYSTEMD !requiretty +Defaults!RESTARTSERVER_INITD !requiretty +Defaults!STARTSERVER_INITD !requiretty +Defaults!STOPSERVER_INITD !requiretty + +#Allow the server to mount iso images +jellyfin ALL=(ALL) NOPASSWD: /bin/mount +jellyfin ALL=(ALL) NOPASSWD: /bin/umount + +Defaults:jellyfin !requiretty diff --git a/deployment/old/debian-package-x64/pkg-src/conf/jellyfin.service.conf b/deployment/old/debian-package-x64/pkg-src/conf/jellyfin.service.conf new file mode 100644 index 0000000000..1b69dd74ef --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/conf/jellyfin.service.conf @@ -0,0 +1,7 @@ +# Jellyfin systemd configuration options + +# Use this file to override the user or environment file location. + +[Service] +#User = jellyfin +#EnvironmentFile = /etc/default/jellyfin diff --git a/deployment/old/debian-package-x64/pkg-src/conf/logging.json b/deployment/old/debian-package-x64/pkg-src/conf/logging.json new file mode 100644 index 0000000000..f32b2089eb --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/conf/logging.json @@ -0,0 +1,30 @@ +{ + "Serilog": { + "MinimumLevel": "Information", + "WriteTo": [ + { + "Name": "Console", + "Args": { + "outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "Async", + "Args": { + "configure": [ + { + "Name": "File", + "Args": { + "path": "%JELLYFIN_LOG_DIR%//jellyfin.log", + "fileSizeLimitBytes": 10485700, + "rollOnFileSizeLimit": true, + "retainedFileCountLimit": 10, + "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}" + } + } + ] + } + } + ] + } +} diff --git a/deployment/old/debian-package-x64/pkg-src/control b/deployment/old/debian-package-x64/pkg-src/control new file mode 100644 index 0000000000..13fd3ecabb --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/control @@ -0,0 +1,31 @@ +Source: jellyfin +Section: misc +Priority: optional +Maintainer: Jellyfin Team +Build-Depends: debhelper (>= 9), + dotnet-sdk-3.1, + libc6-dev, + libcurl4-openssl-dev, + libfontconfig1-dev, + libfreetype6-dev, + libssl-dev, + wget, + npm | nodejs +Standards-Version: 3.9.4 +Homepage: https://jellyfin.media/ +Vcs-Git: https://github.org/jellyfin/jellyfin.git +Vcs-Browser: https://github.org/jellyfin/jellyfin + +Package: jellyfin +Replaces: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server +Breaks: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server +Conflicts: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server +Architecture: any +Depends: at, + libsqlite3-0, + jellyfin-ffmpeg, + libfontconfig1, + libfreetype6, + libssl1.1 +Description: Jellyfin is a home media server. + It is built on top of other popular open source technologies such as Service Stack, jQuery, jQuery mobile, and Mono. It features a REST-based api with built-in documentation to facilitate client development. We also have client libraries for our api to enable rapid development. diff --git a/deployment/old/debian-package-x64/pkg-src/copyright b/deployment/old/debian-package-x64/pkg-src/copyright new file mode 100644 index 0000000000..0d7a2a6007 --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/copyright @@ -0,0 +1,29 @@ +Format: http://dep.debian.net/deps/dep5 +Upstream-Name: jellyfin +Source: https://github.com/jellyfin/jellyfin + +Files: * +Copyright: 2018 Jellyfin Team +License: GPL-2.0+ + +Files: debian/* +Copyright: 2018 Joshua Boniface +Copyright: 2014 Carlos Hernandez +License: GPL-2.0+ + +License: GPL-2.0+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/deployment/old/debian-package-x64/pkg-src/gbp.conf b/deployment/old/debian-package-x64/pkg-src/gbp.conf new file mode 100644 index 0000000000..60b3d28723 --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/gbp.conf @@ -0,0 +1,6 @@ +[DEFAULT] +pristine-tar = False +cleaner = fakeroot debian/rules clean + +[import-orig] +filter = [ ".git*", ".hg*", ".vs*", ".vscode*" ] diff --git a/deployment/old/debian-package-x64/pkg-src/install b/deployment/old/debian-package-x64/pkg-src/install new file mode 100644 index 0000000000..994322d141 --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/install @@ -0,0 +1,6 @@ +usr/lib/jellyfin usr/lib/ +debian/conf/jellyfin etc/default/ +debian/conf/logging.json etc/jellyfin/ +debian/conf/jellyfin.service.conf etc/systemd/system/jellyfin.service.d/ +debian/conf/jellyfin-sudoers etc/sudoers.d/ +debian/bin/restart.sh usr/lib/jellyfin/ diff --git a/deployment/old/debian-package-x64/pkg-src/jellyfin.init b/deployment/old/debian-package-x64/pkg-src/jellyfin.init new file mode 100644 index 0000000000..7f5642bac1 --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/jellyfin.init @@ -0,0 +1,61 @@ +### BEGIN INIT INFO +# Provides: Jellyfin Media Server +# Required-Start: $local_fs $network +# Required-Stop: $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Jellyfin Media Server +# Description: Runs Jellyfin Server +### END INIT INFO + +set -e + +# Carry out specific functions when asked to by the system + +if test -f /etc/default/jellyfin; then + . /etc/default/jellyfin +fi + +. /lib/lsb/init-functions + +PIDFILE="/run/jellyfin.pid" + +case "$1" in + start) + log_daemon_msg "Starting Jellyfin Media Server" "jellyfin" || true + + if start-stop-daemon --start --quiet --oknodo --background --pidfile $PIDFILE --make-pidfile --user $JELLYFIN_USER --chuid $JELLYFIN_USER --exec /usr/bin/jellyfin -- $JELLYFIN_ARGS; then + log_end_msg 0 || true + else + log_end_msg 1 || true + fi + ;; + + stop) + log_daemon_msg "Stopping Jellyfin Media Server" "jellyfin" || true + if start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --remove-pidfile; then + log_end_msg 0 || true + else + log_end_msg 1 || true + fi + ;; + + restart) + log_daemon_msg "Restarting Jellyfin Media Server" "jellyfin" || true + start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PIDFILE --remove-pidfile + if start-stop-daemon --start --quiet --oknodo --background --pidfile $PIDFILE --make-pidfile --user $JELLYFIN_USER --chuid $JELLYFIN_USER --exec /usr/bin/jellyfin -- $JELLYFIN_ARGS; then + log_end_msg 0 || true + else + log_end_msg 1 || true + fi + ;; + + status) + status_of_proc -p $PIDFILE /usr/bin/jellyfin jellyfin && exit 0 || exit $? + ;; + + *) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac diff --git a/deployment/old/debian-package-x64/pkg-src/jellyfin.service b/deployment/old/debian-package-x64/pkg-src/jellyfin.service new file mode 100644 index 0000000000..1305e238b0 --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/jellyfin.service @@ -0,0 +1,14 @@ +[Unit] +Description = Jellyfin Media Server +After = network.target + +[Service] +Type = simple +EnvironmentFile = /etc/default/jellyfin +User = jellyfin +ExecStart = /usr/bin/jellyfin ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT} +Restart = on-failure +TimeoutSec = 15 + +[Install] +WantedBy = multi-user.target diff --git a/deployment/old/debian-package-x64/pkg-src/jellyfin.upstart b/deployment/old/debian-package-x64/pkg-src/jellyfin.upstart new file mode 100644 index 0000000000..ef5bc9bcaf --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/jellyfin.upstart @@ -0,0 +1,20 @@ +description "jellyfin daemon" + +start on (local-filesystems and net-device-up IFACE!=lo) +stop on runlevel [!2345] + +console log +respawn +respawn limit 10 5 + +kill timeout 20 + +script + set -x + echo "Starting $UPSTART_JOB" + + # Log file + logger -t "$0" "DEBUG: `set`" + . /etc/default/jellyfin + exec su -u $JELLYFIN_USER -c /usr/bin/jellyfin $JELLYFIN_ARGS +end script diff --git a/deployment/old/debian-package-x64/pkg-src/po/POTFILES.in b/deployment/old/debian-package-x64/pkg-src/po/POTFILES.in new file mode 100644 index 0000000000..cef83a3407 --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] templates diff --git a/deployment/old/debian-package-x64/pkg-src/po/templates.pot b/deployment/old/debian-package-x64/pkg-src/po/templates.pot new file mode 100644 index 0000000000..2cdcae4173 --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/po/templates.pot @@ -0,0 +1,57 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: jellyfin-server\n" +"Report-Msgid-Bugs-To: jellyfin-server@packages.debian.org\n" +"POT-Creation-Date: 2015-06-12 20:51-0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "Jellyfin permission info:" +msgstr "" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"Jellyfin by default runs under a user named \"jellyfin\". Please ensure that the " +"user jellyfin has read and write access to any folders you wish to add to your " +"library. Otherwise please run jellyfin under a different user." +msgstr "" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Username to run Jellyfin as:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "The user that jellyfin will run as." +msgstr "" + +#. Type: note +#. Description +#: ../templates:3001 +msgid "Jellyfin still running" +msgstr "" + +#. Type: note +#. Description +#: ../templates:3001 +msgid "Jellyfin is currently running. Please close it and try again." +msgstr "" diff --git a/deployment/old/debian-package-x64/pkg-src/postinst b/deployment/old/debian-package-x64/pkg-src/postinst new file mode 100644 index 0000000000..860222e051 --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/postinst @@ -0,0 +1,92 @@ +#!/bin/bash +set -e + +NAME=jellyfin +DEFAULT_FILE=/etc/default/${NAME} + +# Source Jellyfin default configuration +if [[ -f $DEFAULT_FILE ]]; then + . $DEFAULT_FILE +fi + +# Data directories for program data (cache, db), configs, and logs +PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} +CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} +LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} +CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} + +case "$1" in + configure) + # create jellyfin group if it does not exist + if [[ -z "$(getent group jellyfin)" ]]; then + addgroup --quiet --system jellyfin > /dev/null 2>&1 + fi + # create jellyfin user if it does not exist + if [[ -z "$(getent passwd jellyfin)" ]]; then + adduser --system --ingroup jellyfin --shell /bin/false jellyfin --no-create-home --home ${PROGRAMDATA} \ + --gecos "Jellyfin default user" > /dev/null 2>&1 + fi + # ensure $PROGRAMDATA exists + if [[ ! -d $PROGRAMDATA ]]; then + mkdir $PROGRAMDATA + fi + # ensure $CONFIGDATA exists + if [[ ! -d $CONFIGDATA ]]; then + mkdir $CONFIGDATA + fi + # ensure $LOGDATA exists + if [[ ! -d $LOGDATA ]]; then + mkdir $LOGDATA + fi + # ensure $CACHEDATA exists + if [[ ! -d $CACHEDATA ]]; then + mkdir $CACHEDATA + fi + # Ensure permissions are correct on all config directories + chown -R jellyfin $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA + chgrp adm $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA + chmod 0750 $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA + + chmod +x /usr/lib/jellyfin/restart.sh > /dev/null 2>&1 || true + + # Install jellyfin symlink into /usr/bin + ln -sf /usr/lib/jellyfin/bin/jellyfin /usr/bin/jellyfin + + ;; + abort-upgrade|abort-remove|abort-deconfigure) + ;; + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER + +if [[ -x "/usr/bin/deb-systemd-helper" ]]; then + # Manual init script handling + deb-systemd-helper unmask jellyfin.service >/dev/null || true + # was-enabled defaults to true, so new installations run enable. + if deb-systemd-helper --quiet was-enabled jellyfin.service; then + # Enables the unit on first installation, creates new + # symlinks on upgrades if the unit file has changed. + deb-systemd-helper enable jellyfin.service >/dev/null || true + else + # Update the statefile to add new symlinks (if any), which need to be + # cleaned up on purge. Also remove old symlinks. + deb-systemd-helper update-state jellyfin.service >/dev/null || true + fi +fi + +# End automatically added section +# Automatically added by dh_installinit +if [[ "$1" == "configure" ]] || [[ "$1" == "abort-upgrade" ]]; then + if [[ -d "/run/systemd/systemd" ]]; then + systemctl --system daemon-reload >/dev/null || true + deb-systemd-invoke start jellyfin >/dev/null || true + elif [[ -x "/etc/init.d/jellyfin" ]] || [[ -e "/etc/init/jellyfin.conf" ]]; then + update-rc.d jellyfin defaults >/dev/null + invoke-rc.d jellyfin start || exit $? + fi +fi +exit 0 diff --git a/deployment/old/debian-package-x64/pkg-src/postrm b/deployment/old/debian-package-x64/pkg-src/postrm new file mode 100644 index 0000000000..1d00a984ec --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/postrm @@ -0,0 +1,81 @@ +#!/bin/bash +set -e + +NAME=jellyfin +DEFAULT_FILE=/etc/default/${NAME} + +# Source Jellyfin default configuration +if [[ -f $DEFAULT_FILE ]]; then + . $DEFAULT_FILE +fi + +# Data directories for program data (cache, db), configs, and logs +PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} +CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} +LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} +CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} + +# In case this system is running systemd, we make systemd reload the unit files +# to pick up changes. +if [[ -d /run/systemd/system ]] ; then + systemctl --system daemon-reload >/dev/null || true +fi + +case "$1" in + purge) + echo PURGE | debconf-communicate $NAME > /dev/null 2>&1 || true + + if [[ -x "/etc/init.d/jellyfin" ]] || [[ -e "/etc/init/jellyfin.connf" ]]; then + update-rc.d jellyfin remove >/dev/null 2>&1 || true + fi + + if [[ -x "/usr/bin/deb-systemd-helper" ]]; then + deb-systemd-helper purge jellyfin.service >/dev/null + deb-systemd-helper unmask jellyfin.service >/dev/null + fi + + # Remove user and group + userdel jellyfin > /dev/null 2>&1 || true + delgroup --quiet jellyfin > /dev/null 2>&1 || true + # Remove config dir + if [[ -d $CONFIGDATA ]]; then + rm -rf $CONFIGDATA + fi + # Remove log dir + if [[ -d $LOGDATA ]]; then + rm -rf $LOGDATA + fi + # Remove cache dir + if [[ -d $CACHEDATA ]]; then + rm -rf $CACHEDATA + fi + # Remove program data dir + if [[ -d $PROGRAMDATA ]]; then + rm -rf $PROGRAMDATA + fi + # Remove binary symlink + [[ -f /usr/bin/jellyfin ]] && rm /usr/bin/jellyfin + # Remove sudoers config + [[ -f /etc/sudoers.d/jellyfin-sudoers ]] && rm /etc/sudoers.d/jellyfin-sudoers + # Remove anything at the default locations; catches situations where the user moved the defaults + [[ -e /etc/jellyfin ]] && rm -rf /etc/jellyfin + [[ -e /var/log/jellyfin ]] && rm -rf /var/log/jellyfin + [[ -e /var/cache/jellyfin ]] && rm -rf /var/cache/jellyfin + [[ -e /var/lib/jellyfin ]] && rm -rf /var/lib/jellyfin + ;; + remove) + if [[ -x "/usr/bin/deb-systemd-helper" ]]; then + deb-systemd-helper mask jellyfin.service >/dev/null + fi + ;; + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/deployment/old/debian-package-x64/pkg-src/preinst b/deployment/old/debian-package-x64/pkg-src/preinst new file mode 100644 index 0000000000..2713fb9b80 --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/preinst @@ -0,0 +1,78 @@ +#!/bin/bash +set -e + +NAME=jellyfin +DEFAULT_FILE=/etc/default/${NAME} + +# Source Jellyfin default configuration +if [[ -f $DEFAULT_FILE ]]; then + . $DEFAULT_FILE +fi + +# Data directories for program data (cache, db), configs, and logs +PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} +CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} +LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} +CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} + +# In case this system is running systemd, we make systemd reload the unit files +# to pick up changes. +if [[ -d /run/systemd/system ]] ; then + systemctl --system daemon-reload >/dev/null || true +fi + +case "$1" in + install|upgrade) + # try graceful termination; + if [[ -d /run/systemd/system ]]; then + deb-systemd-invoke stop ${NAME}.service > /dev/null 2>&1 || true + elif [ -x "/etc/init.d/${NAME}" ] || [ -e "/etc/init/${NAME}.conf" ]; then + invoke-rc.d ${NAME} stop > /dev/null 2>&1 || true + fi + # try and figure out if jellyfin is running + PIDFILE=$(find /var/run/ -maxdepth 1 -mindepth 1 -name "jellyfin*.pid" -print -quit) + [[ -n "$PIDFILE" ]] && [[ -s "$PIDFILE" ]] && JELLYFIN_PID=$(cat ${PIDFILE}) + # if its running, let's stop it + if [[ -n "$JELLYFIN_PID" ]]; then + echo "Stopping Jellyfin!" + # if jellyfin is still running, kill it + if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then + CPIDS=$(pgrep -P $JELLYFIN_PID) + sleep 2 && kill -KILL $CPIDS + kill -TERM $CPIDS > /dev/null 2>&1 + fi + sleep 1 + # if it's still running, show error + if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then + echo "Could not successfully stop JellyfinServer, please do so before uninstalling." + exit 1 + else + [[ -f $PIDFILE ]] && rm $PIDFILE + fi + fi + + # Clean up old Emby cruft that can break the user's system + [[ -f /etc/sudoers.d/emby ]] && rm -f /etc/sudoers.d/emby + + # If we have existing config, log, or cache dirs in /var/lib/jellyfin, move them into the right place + if [[ -d $PROGRAMDATA/config ]]; then + mv $PROGRAMDATA/config $CONFIGDATA + fi + if [[ -d $PROGRAMDATA/logs ]]; then + mv $PROGRAMDATA/logs $LOGDATA + fi + if [[ -d $PROGRAMDATA/logs ]]; then + mv $PROGRAMDATA/cache $CACHEDATA + fi + + ;; + abort-upgrade) + ;; + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac +#DEBHELPER# + +exit 0 diff --git a/deployment/old/debian-package-x64/pkg-src/prerm b/deployment/old/debian-package-x64/pkg-src/prerm new file mode 100644 index 0000000000..e965cb7d71 --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/prerm @@ -0,0 +1,61 @@ +#!/bin/bash +set -e + +NAME=jellyfin +DEFAULT_FILE=/etc/default/${NAME} + +# Source Jellyfin default configuration +if [[ -f $DEFAULT_FILE ]]; then + . $DEFAULT_FILE +fi + +# Data directories for program data (cache, db), configs, and logs +PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} +CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} +LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} +CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} + +case "$1" in + remove|upgrade|deconfigure) + echo "Stopping Jellyfin!" + # try graceful termination; + if [[ -d /run/systemd/system ]]; then + deb-systemd-invoke stop ${NAME}.service > /dev/null 2>&1 || true + elif [ -x "/etc/init.d/${NAME}" ] || [ -e "/etc/init/${NAME}.conf" ]; then + invoke-rc.d ${NAME} stop > /dev/null 2>&1 || true + fi + # Ensure that it is shutdown + PIDFILE=$(find /var/run/ -maxdepth 1 -mindepth 1 -name "jellyfin*.pid" -print -quit) + [[ -n "$PIDFILE" ]] && [[ -s "$PIDFILE" ]] && JELLYFIN_PID=$(cat ${PIDFILE}) + # if its running, let's stop it + if [[ -n "$JELLYFIN_PID" ]]; then + # if jellyfin is still running, kill it + if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then + CPIDS=$(pgrep -P $JELLYFIN_PID) + sleep 2 && kill -KILL $CPIDS + kill -TERM $CPIDS > /dev/null 2>&1 + fi + sleep 1 + # if it's still running, show error + if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then + echo "Could not successfully stop Jellyfin, please do so before uninstalling." + exit 1 + else + [[ -f $PIDFILE ]] && rm $PIDFILE + fi + fi + if [[ -f /usr/lib/jellyfin/bin/MediaBrowser.Server.Mono.exe.so ]]; then + rm /usr/lib/jellyfin/bin/MediaBrowser.Server.Mono.exe.so + fi + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/deployment/old/debian-package-x64/pkg-src/rules b/deployment/old/debian-package-x64/pkg-src/rules new file mode 100755 index 0000000000..c2d57dfb22 --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/rules @@ -0,0 +1,66 @@ +#! /usr/bin/make -f +CONFIG := Release +TERM := xterm +SHELL := /bin/bash +WEB_TARGET := $(CURDIR)/MediaBrowser.WebDashboard/jellyfin-web +WEB_VERSION := $(shell sed -n -e 's/^version: "\(.*\)"/\1/p' $(CURDIR)/build.yaml) + +HOST_ARCH := $(shell arch) +BUILD_ARCH := ${DEB_HOST_MULTIARCH} +ifeq ($(HOST_ARCH),x86_64) + # Building AMD64 + DOTNETRUNTIME := debian-x64 + ifeq ($(BUILD_ARCH),arm-linux-gnueabihf) + # Cross-building ARM on AMD64 + DOTNETRUNTIME := debian-arm + endif + ifeq ($(BUILD_ARCH),aarch64-linux-gnu) + # Cross-building ARM on AMD64 + DOTNETRUNTIME := debian-arm64 + endif +endif +ifeq ($(HOST_ARCH),armv7l) + # Building ARM + DOTNETRUNTIME := debian-arm +endif +ifeq ($(HOST_ARCH),arm64) + # Building ARM + DOTNETRUNTIME := debian-arm64 +endif + +export DH_VERBOSE=1 +export DOTNET_CLI_TELEMETRY_OPTOUT=1 + +%: + dh $@ + +# disable "make check" +override_dh_auto_test: + +# disable stripping debugging symbols +override_dh_clistrip: + +override_dh_auto_build: + echo $(WEB_VERSION) + # Clone down and build Web frontend + mkdir -p $(WEB_TARGET) + wget -O web-src.tgz https://github.com/jellyfin/jellyfin-web/archive/v$(WEB_VERSION).tar.gz || wget -O web-src.tgz https://github.com/jellyfin/jellyfin-web/archive/master.tar.gz + mkdir -p $(CURDIR)/web + tar -xzf web-src.tgz -C $(CURDIR)/web/ --strip 1 + cd $(CURDIR)/web/ && npm install yarn + cd $(CURDIR)/web/ && node_modules/yarn/bin/yarn install + mv $(CURDIR)/web/dist/* $(WEB_TARGET)/ + # Build the application + dotnet publish --configuration $(CONFIG) --output='$(CURDIR)/usr/lib/jellyfin/bin' --self-contained --runtime $(DOTNETRUNTIME) \ + "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" Jellyfin.Server + +override_dh_auto_clean: + dotnet clean -maxcpucount:1 --configuration $(CONFIG) Jellyfin.Server || true + rm -f '$(CURDIR)/web-src.tgz' + rm -rf '$(CURDIR)/usr' + rm -rf '$(CURDIR)/web' + rm -rf '$(WEB_TARGET)' + +# Force the service name to jellyfin even if we're building jellyfin-nightly +override_dh_installinit: + dh_installinit --name=jellyfin diff --git a/deployment/old/debian-package-x64/pkg-src/source.lintian-overrides b/deployment/old/debian-package-x64/pkg-src/source.lintian-overrides new file mode 100644 index 0000000000..aeb332f13a --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/source.lintian-overrides @@ -0,0 +1,3 @@ +# This is an override for the following lintian errors: +jellyfin source: license-problem-md5sum-non-free-file Emby.Drawing/ImageMagick/fonts/webdings.ttf* +jellyfin source: source-is-missing diff --git a/deployment/old/debian-package-x64/pkg-src/source/format b/deployment/old/debian-package-x64/pkg-src/source/format new file mode 100644 index 0000000000..d3827e75a5 --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/source/format @@ -0,0 +1 @@ +1.0 diff --git a/deployment/old/debian-package-x64/pkg-src/source/options b/deployment/old/debian-package-x64/pkg-src/source/options new file mode 100644 index 0000000000..17b5373d5e --- /dev/null +++ b/deployment/old/debian-package-x64/pkg-src/source/options @@ -0,0 +1,11 @@ +tar-ignore='.git*' +tar-ignore='**/.git' +tar-ignore='**/.hg' +tar-ignore='**/.vs' +tar-ignore='**/.vscode' +tar-ignore='deployment' +tar-ignore='**/bin' +tar-ignore='**/obj' +tar-ignore='**/.nuget' +tar-ignore='*.deb' +tar-ignore='ThirdParty' diff --git a/deployment/old/fedora-package-x64/Dockerfile b/deployment/old/fedora-package-x64/Dockerfile new file mode 100644 index 0000000000..87120f3a05 --- /dev/null +++ b/deployment/old/fedora-package-x64/Dockerfile @@ -0,0 +1,33 @@ +FROM fedora:31 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/fedora-package-x64 +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist + +# Prepare Fedora environment +RUN dnf update -y + +# Install build dependencies +RUN dnf install -y @buildsys-build rpmdevtools git dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel nodejs-yarn + +# Install DotNET SDK +RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \ + && curl -o /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/$(rpm -E %fedora)/prod.repo \ + && dnf install -y dotnet-sdk-${SDK_VERSION} dotnet-runtime-${SDK_VERSION} + +# Create symlinks and directories +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh \ + && mkdir -p ${SOURCE_DIR}/SPECS \ + && ln -s ${PLATFORM_DIR}/pkg-src/jellyfin.spec ${SOURCE_DIR}/SPECS/jellyfin.spec \ + && mkdir -p ${SOURCE_DIR}/SOURCES \ + && ln -s ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/SOURCES + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/fedora-package-x64/clean.sh b/deployment/old/fedora-package-x64/clean.sh new file mode 100755 index 0000000000..700c8f1bb3 --- /dev/null +++ b/deployment/old/fedora-package-x64/clean.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +keep_artifacts="${1}" + +WORKDIR="$( pwd )" +VERSION="$( grep -A1 '^Version:' ${WORKDIR}/pkg-src/jellyfin.spec | awk '{ print $NF }' )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +package_source_dir="${WORKDIR}/pkg-src" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-fedora-build" + +rm -f "${package_source_dir}/jellyfin-${VERSION}.tar.gz" &>/dev/null \ + || sudo rm -f "${package_source_dir}/jellyfin-${VERSION}.tar.gz" &>/dev/null + +rm -rf "${package_temporary_dir}" &>/dev/null \ + || sudo rm -rf "${package_temporary_dir}" &>/dev/null + +rm -rf "${output_dir}" &>/dev/null \ + || sudo rm -rf "${output_dir}" &>/dev/null + +if [[ ${keep_artifacts} == 'n' ]]; then + docker_sudo="" + if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo=sudo + fi + ${docker_sudo} docker image rm ${image_name} --force +fi diff --git a/deployment/old/fedora-package-x64/dependencies.txt b/deployment/old/fedora-package-x64/dependencies.txt new file mode 100644 index 0000000000..bdb9670965 --- /dev/null +++ b/deployment/old/fedora-package-x64/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/old/fedora-package-x64/docker-build.sh b/deployment/old/fedora-package-x64/docker-build.sh new file mode 100755 index 0000000000..740e8d35ca --- /dev/null +++ b/deployment/old/fedora-package-x64/docker-build.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Builds the RPM inside the Docker container + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Build RPM +make -f .copr/Makefile srpm outdir=/root/rpmbuild/SRPMS +rpmbuild -rb /root/rpmbuild/SRPMS/jellyfin-*.src.rpm + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/rpm +mv /root/rpmbuild/RPMS/x86_64/jellyfin-*.rpm /root/rpmbuild/SRPMS/jellyfin-*.src.rpm ${ARTIFACT_DIR}/rpm/ +chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/fedora-package-x64/package.sh b/deployment/old/fedora-package-x64/package.sh new file mode 100755 index 0000000000..ae6962dd1f --- /dev/null +++ b/deployment/old/fedora-package-x64/package.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +args="${@}" +declare -a docker_envvars +for arg in ${args}; do + docker_envvars+=("-e ${arg}") +done + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-fedora-build" + +# Determine if sudo should be used for Docker +if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo="sudo" +else + docker_sudo="" +fi + +# Prepare temporary package dir +mkdir -p "${package_temporary_dir}" +# Set up the build environment Docker image +${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile +# Build the RPMs and copy out to ${package_temporary_dir} +${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} +# Move the RPMs to the output directory +mkdir -p "${output_dir}" +mv "${package_temporary_dir}"/rpm/* "${output_dir}" diff --git a/deployment/old/fedora-package-x64/pkg-src/.gitignore b/deployment/old/fedora-package-x64/pkg-src/.gitignore new file mode 100644 index 0000000000..6019b98c22 --- /dev/null +++ b/deployment/old/fedora-package-x64/pkg-src/.gitignore @@ -0,0 +1,3 @@ +*.rpm +*.zip +*.tar.gz \ No newline at end of file diff --git a/deployment/old/fedora-package-x64/pkg-src/README.md b/deployment/old/fedora-package-x64/pkg-src/README.md new file mode 100644 index 0000000000..7ed6f7efc6 --- /dev/null +++ b/deployment/old/fedora-package-x64/pkg-src/README.md @@ -0,0 +1,43 @@ +# Jellyfin RPM + +## Build Fedora Package with docker + +Change into this directory `cd rpm-package` +Run the build script `./build-fedora-rpm.sh`. +Resulting RPM and src.rpm will be in `../../jellyfin-*.rpm` + +## ffmpeg + +The RPM package for Fedora/CentOS requires some additional repositories as ffmpeg is not in the main repositories. + +```shell +# ffmpeg from RPMfusion free +# Fedora +$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm +# CentOS 7 +$ sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm +``` + +## ISO mounting + +To allow Jellyfin to mount/umount ISO files uncomment these two lines in `/etc/sudoers.d/jellyfin-sudoers` +``` +# %jellyfin ALL=(ALL) NOPASSWD: /bin/mount +# %jellyfin ALL=(ALL) NOPASSWD: /bin/umount +``` + +## Building with dotnet + +Jellyfin is build with `--self-contained` so no dotnet required for runtime. + +```shell +# dotnet required for building the RPM +# Fedora +$ sudo dnf copr enable @dotnet-sig/dotnet +# CentOS +$ sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm +``` + +## TODO + +- [ ] OpenSUSE \ No newline at end of file diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin-firewalld.xml b/deployment/old/fedora-package-x64/pkg-src/jellyfin-firewalld.xml new file mode 100644 index 0000000000..538c5d65f8 --- /dev/null +++ b/deployment/old/fedora-package-x64/pkg-src/jellyfin-firewalld.xml @@ -0,0 +1,9 @@ + + + Jellyfin + The Free Software Media System. + + + + + diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin.env b/deployment/old/fedora-package-x64/pkg-src/jellyfin.env new file mode 100644 index 0000000000..de48f13af5 --- /dev/null +++ b/deployment/old/fedora-package-x64/pkg-src/jellyfin.env @@ -0,0 +1,34 @@ +# Jellyfin default configuration options + +# Use this file to override the default configurations; add additional +# options with JELLYFIN_ADD_OPTS. + +# To override the user or this config file's location, use +# /etc/systemd/system/jellyfin.service.d/override.conf + +# +# This is a POSIX shell fragment +# + +# +# General options +# + +# Program directories +JELLYFIN_DATA_DIR="/var/lib/jellyfin" +JELLYFIN_CONFIG_DIR="/etc/jellyfin" +JELLYFIN_LOG_DIR="/var/log/jellyfin" +JELLYFIN_CACHE_DIR="/var/cache/jellyfin" + +# In-App service control +JELLYFIN_RESTART_OPT="--restartpath=/usr/libexec/jellyfin/restart.sh" + +# [OPTIONAL] ffmpeg binary paths, overriding the UI-configured values +#JELLYFIN_FFMPEG_OPT="--ffmpeg=/usr/bin/ffmpeg" + +# [OPTIONAL] run Jellyfin as a headless service +#JELLYFIN_SERVICE_OPT="--service" + +# [OPTIONAL] run Jellyfin without the web app +#JELLYFIN_NOWEBAPP_OPT="--noautorunwebapp" + diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin.override.conf b/deployment/old/fedora-package-x64/pkg-src/jellyfin.override.conf new file mode 100644 index 0000000000..8652450bb4 --- /dev/null +++ b/deployment/old/fedora-package-x64/pkg-src/jellyfin.override.conf @@ -0,0 +1,7 @@ +# Jellyfin systemd configuration options + +# Use this file to override the user or environment file location. + +[Service] +#User = jellyfin +#EnvironmentFile = /etc/sysconfig/jellyfin diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin.service b/deployment/old/fedora-package-x64/pkg-src/jellyfin.service new file mode 100644 index 0000000000..f3dc594b1c --- /dev/null +++ b/deployment/old/fedora-package-x64/pkg-src/jellyfin.service @@ -0,0 +1,15 @@ +[Unit] +After=network.target +Description=Jellyfin is a free software media system that puts you in control of managing and streaming your media. + +[Service] +EnvironmentFile=/etc/sysconfig/jellyfin +WorkingDirectory=/var/lib/jellyfin +ExecStart=/usr/bin/jellyfin ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT} +TimeoutSec=15 +Restart=on-failure +User=jellyfin +Group=jellyfin + +[Install] +WantedBy=multi-user.target diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin.spec b/deployment/old/fedora-package-x64/pkg-src/jellyfin.spec new file mode 100644 index 0000000000..33c6f6f648 --- /dev/null +++ b/deployment/old/fedora-package-x64/pkg-src/jellyfin.spec @@ -0,0 +1,181 @@ +%global debug_package %{nil} +# Set the dotnet runtime +%if 0%{?fedora} +%global dotnet_runtime fedora-x64 +%else +%global dotnet_runtime centos-x64 +%endif + +Name: jellyfin +Version: 10.5.0 +Release: 1%{?dist} +Summary: The Free Software Media Browser +License: GPLv2 +URL: https://jellyfin.media +# Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%{version}.tar.gz` +Source0: https://github.com/%{name}/%{name}/archive/%{name}-%{version}.tar.gz +# Jellyfin Webinterface downloaded by `make -f .copr/Makefile srpm`, real URL ends with `v%{version}.tar.gz` +Source1: https://github.com/%{name}/%{name}-web/archive/%{name}-web-%{version}.tar.gz +Source11: jellyfin.service +Source12: jellyfin.env +Source13: jellyfin.sudoers +Source14: restart.sh +Source15: jellyfin.override.conf +Source16: jellyfin-firewalld.xml + +%{?systemd_requires} +BuildRequires: systemd +Requires(pre): shadow-utils +BuildRequires: libcurl-devel, fontconfig-devel, freetype-devel, openssl-devel, glibc-devel, libicu-devel, git +%if 0%{?fedora} +BuildRequires: nodejs-yarn, git +%else +# Requirements not packaged in main repos +# From https://rpm.nodesource.com/pub_10.x/el/7/x86_64/ +BuildRequires: nodejs >= 10 yarn +%endif +Requires: libcurl, fontconfig, freetype, openssl, glibc libicu +# Requirements not packaged in main repos +# COPR @dotnet-sig/dotnet or +# https://packages.microsoft.com/rhel/7/prod/ +BuildRequires: dotnet-runtime-3.1, dotnet-sdk-3.1 +# RPMfusion free +Requires: ffmpeg + +# Disable Automatic Dependency Processing +AutoReqProv: no + +%description +Jellyfin is a free software media system that puts you in control of managing and streaming your media. + + +%prep +%autosetup -n %{name}-%{version} -b 0 -b 1 +web_build_dir="$(mktemp -d)" +web_target="$PWD/MediaBrowser.WebDashboard/jellyfin-web" +pushd ../jellyfin-web-%{version} || pushd ../jellyfin-web-master +%if 0%{?fedora} +nodejs-yarn install +%else +yarn install +%endif +mkdir -p ${web_target} +mv dist/* ${web_target}/ +popd + +%build + +%install +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime %{dotnet_runtime} \ + "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" Jellyfin.Server +%{__install} -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/%{name}/LICENSE +%{__install} -D -m 0644 %{SOURCE15} %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/override.conf +%{__install} -D -m 0644 Jellyfin.Server/Resources/Configuration/logging.json %{buildroot}%{_sysconfdir}/%{name}/logging.json +%{__mkdir} -p %{buildroot}%{_bindir} +tee %{buildroot}%{_bindir}/jellyfin << EOF +#!/bin/sh +exec %{_libdir}/%{name}/%{name} \${@} +EOF +%{__mkdir} -p %{buildroot}%{_sharedstatedir}/jellyfin +%{__mkdir} -p %{buildroot}%{_sysconfdir}/%{name} +%{__mkdir} -p %{buildroot}%{_var}/log/jellyfin +%{__mkdir} -p %{buildroot}%{_var}/cache/jellyfin + +%{__install} -D -m 0644 %{SOURCE11} %{buildroot}%{_unitdir}/%{name}.service +%{__install} -D -m 0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/sysconfig/%{name} +%{__install} -D -m 0600 %{SOURCE13} %{buildroot}%{_sysconfdir}/sudoers.d/%{name}-sudoers +%{__install} -D -m 0755 %{SOURCE14} %{buildroot}%{_libexecdir}/%{name}/restart.sh +%{__install} -D -m 0644 %{SOURCE16} %{buildroot}%{_prefix}/lib/firewalld/services/%{name}.xml + +%files +%{_libdir}/%{name}/jellyfin-web/* +%attr(755,root,root) %{_bindir}/%{name} +%{_libdir}/%{name}/*.json +%{_libdir}/%{name}/*.dll +%{_libdir}/%{name}/*.so +%{_libdir}/%{name}/*.a +%{_libdir}/%{name}/createdump +# Needs 755 else only root can run it since binary build by dotnet is 722 +%attr(755,root,root) %{_libdir}/%{name}/jellyfin +%{_libdir}/%{name}/SOS_README.md +%{_unitdir}/%{name}.service +%{_libexecdir}/%{name}/restart.sh +%{_prefix}/lib/firewalld/services/%{name}.xml +%attr(755,jellyfin,jellyfin) %dir %{_sysconfdir}/%{name} +%config %{_sysconfdir}/sysconfig/%{name} +%config(noreplace) %attr(600,root,root) %{_sysconfdir}/sudoers.d/%{name}-sudoers +%config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/override.conf +%config(noreplace) %attr(644,jellyfin,jellyfin) %{_sysconfdir}/%{name}/logging.json +%attr(750,jellyfin,jellyfin) %dir %{_sharedstatedir}/jellyfin +%attr(-,jellyfin,jellyfin) %dir %{_var}/log/jellyfin +%attr(750,jellyfin,jellyfin) %dir %{_var}/cache/jellyfin +%if 0%{?fedora} +%license LICENSE +%else +%{_datadir}/licenses/%{name}/LICENSE +%endif + +%pre +getent group jellyfin >/dev/null || groupadd -r jellyfin +getent passwd jellyfin >/dev/null || \ + useradd -r -g jellyfin -d %{_sharedstatedir}/jellyfin -s /sbin/nologin \ + -c "Jellyfin default user" jellyfin +exit 0 + +%post +# Move existing configuration cache and logs to their new locations and symlink them. +if [ $1 -gt 1 ] ; then + service_state=$(systemctl is-active jellyfin.service) + if [ "${service_state}" = "active" ]; then + systemctl stop jellyfin.service + fi + if [ ! -L %{_sharedstatedir}/%{name}/config ]; then + mv %{_sharedstatedir}/%{name}/config/* %{_sysconfdir}/%{name}/ + rmdir %{_sharedstatedir}/%{name}/config + ln -sf %{_sysconfdir}/%{name} %{_sharedstatedir}/%{name}/config + fi + if [ ! -L %{_sharedstatedir}/%{name}/logs ]; then + mv %{_sharedstatedir}/%{name}/logs/* %{_var}/log/jellyfin + rmdir %{_sharedstatedir}/%{name}/logs + ln -sf %{_var}/log/jellyfin %{_sharedstatedir}/%{name}/logs + fi + if [ ! -L %{_sharedstatedir}/%{name}/cache ]; then + mv %{_sharedstatedir}/%{name}/cache/* %{_var}/cache/jellyfin + rmdir %{_sharedstatedir}/%{name}/cache + ln -sf %{_var}/cache/jellyfin %{_sharedstatedir}/%{name}/cache + fi + if [ "${service_state}" = "active" ]; then + systemctl start jellyfin.service + fi +fi +%systemd_post jellyfin.service + +%preun +%systemd_preun jellyfin.service + +%postun +%systemd_postun_with_restart jellyfin.service + +%changelog +* Fri Oct 11 2019 Jellyfin Packaging Team +- New upstream version 10.5.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.5.0 +* Sat Aug 31 2019 Jellyfin Packaging Team +- New upstream version 10.4.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.4.0 +* Wed Jul 24 2019 Jellyfin Packaging Team +- New upstream version 10.3.7; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.7 +* Sat Jul 06 2019 Jellyfin Packaging Team +- New upstream version 10.3.6; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.6 +* Sun Jun 09 2019 Jellyfin Packaging Team +- New upstream version 10.3.5; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.5 +* Thu Jun 06 2019 Jellyfin Packaging Team +- New upstream version 10.3.4; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.4 +* Fri May 17 2019 Jellyfin Packaging Team +- New upstream version 10.3.3; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.3 +* Tue Apr 30 2019 Jellyfin Packaging Team +- New upstream version 10.3.2; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.2 +* Sat Apr 20 2019 Jellyfin Packaging Team +- New upstream version 10.3.1; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.1 +* Fri Apr 19 2019 Jellyfin Packaging Team +- New upstream version 10.3.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.0 diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin.sudoers b/deployment/old/fedora-package-x64/pkg-src/jellyfin.sudoers new file mode 100644 index 0000000000..dd245af4b8 --- /dev/null +++ b/deployment/old/fedora-package-x64/pkg-src/jellyfin.sudoers @@ -0,0 +1,19 @@ +# Allow jellyfin group to start, stop and restart itself +Cmnd_Alias RESTARTSERVER_SYSTEMD = /usr/bin/systemctl restart jellyfin, /bin/systemctl restart jellyfin +Cmnd_Alias STARTSERVER_SYSTEMD = /usr/bin/systemctl start jellyfin, /bin/systemctl start jellyfin +Cmnd_Alias STOPSERVER_SYSTEMD = /usr/bin/systemctl stop jellyfin, /bin/systemctl stop jellyfin + + +jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSTEMD +jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSTEMD +jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSTEMD + +Defaults!RESTARTSERVER_SYSTEMD !requiretty +Defaults!STARTSERVER_SYSTEMD !requiretty +Defaults!STOPSERVER_SYSTEMD !requiretty + +# Allow the server to mount iso images +jellyfin ALL=(ALL) NOPASSWD: /bin/mount +jellyfin ALL=(ALL) NOPASSWD: /bin/umount + +Defaults:jellyfin !requiretty diff --git a/deployment/old/fedora-package-x64/pkg-src/restart.sh b/deployment/old/fedora-package-x64/pkg-src/restart.sh new file mode 100755 index 0000000000..9b64b6d728 --- /dev/null +++ b/deployment/old/fedora-package-x64/pkg-src/restart.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# restart.sh - Jellyfin server restart script +# Part of the Jellyfin project (https://github.com/jellyfin) +# +# This script restarts the Jellyfin daemon on Linux when using +# the Restart button on the admin dashboard. It supports the +# systemctl, service, and traditional /etc/init.d (sysv) restart +# methods, chosen automatically by which one is found first (in +# that order). +# +# This script is used by the Debian/Ubuntu/Fedora/CentOS packages. + +get_service_command() { + for command in systemctl service; do + if which $command &>/dev/null; then + echo $command && return + fi + done + echo "sysv" +} + +cmd="$( get_service_command )" +echo "Detected service control platform '$cmd'; using it to restart Jellyfin..." +case $cmd in + 'systemctl') + echo "sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin" | at now + ;; + 'service') + echo "sleep 2; /usr/bin/sudo $( which service ) jellyfin restart" | at now + ;; + 'sysv') + echo "sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart" | at now + ;; +esac +exit 0 diff --git a/deployment/old/linux-x64/Dockerfile b/deployment/old/linux-x64/Dockerfile new file mode 100644 index 0000000000..c47057546d --- /dev/null +++ b/deployment/old/linux-x64/Dockerfile @@ -0,0 +1,37 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/linux-x64 +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Install yarn package manager +RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ + && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ + && apt update \ + && apt install -y yarn + +# Link to docker-build script +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/linux-x64/clean.sh b/deployment/old/linux-x64/clean.sh new file mode 100755 index 0000000000..c07501a7bb --- /dev/null +++ b/deployment/old/linux-x64/clean.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +keep_artifacts="${1}" + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-linux-build" + +rm -rf "${package_temporary_dir}" &>/dev/null \ + || sudo rm -rf "${package_temporary_dir}" &>/dev/null + +rm -rf "${output_dir}" &>/dev/null \ + || sudo rm -rf "${output_dir}" &>/dev/null + +if [[ ${keep_artifacts} == 'n' ]]; then + docker_sudo="" + if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo=sudo + fi + ${docker_sudo} docker image rm ${image_name} --force +fi diff --git a/deployment/old/linux-x64/dependencies.txt b/deployment/old/linux-x64/dependencies.txt new file mode 100644 index 0000000000..bdb9670965 --- /dev/null +++ b/deployment/old/linux-x64/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/old/linux-x64/docker-build.sh b/deployment/old/linux-x64/docker-build.sh new file mode 100755 index 0000000000..e33328a36a --- /dev/null +++ b/deployment/old/linux-x64/docker-build.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Builds the TAR archive inside the Docker container + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Clone down and build Web frontend +web_build_dir="$( mktemp -d )" +web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web" +git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/ +pushd ${web_build_dir} +if [[ -n ${web_branch} ]]; then + checkout -b origin/${web_branch} +fi +yarn install +mkdir -p ${web_target} +mv dist/* ${web_target}/ +popd +rm -rf ${web_build_dir} + +# Get version +version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" + +# Build archives +dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime linux-x64 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true" +tar -cvzf /jellyfin_${version}.portable.tar.gz -C /dist jellyfin_${version} +rm -rf /dist/jellyfin_${version} + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/ +mv /jellyfin[-_]*.tar.gz ${ARTIFACT_DIR}/ +chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/linux-x64/package.sh b/deployment/old/linux-x64/package.sh new file mode 100755 index 0000000000..dfe8a9aa4a --- /dev/null +++ b/deployment/old/linux-x64/package.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +args="${@}" +declare -a docker_envvars +for arg in ${args}; do + docker_envvars+=("-e ${arg}") +done + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-linux-build" + +# Determine if sudo should be used for Docker +if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo="sudo" +else + docker_sudo="" +fi + +# Prepare temporary package dir +mkdir -p "${package_temporary_dir}" +# Set up the build environment Docker image +${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile +# Build the DEBs and copy out to ${package_temporary_dir} +${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} +# Move the DEBs to the output directory +mkdir -p "${output_dir}" +mv "${package_temporary_dir}"/* "${output_dir}" diff --git a/deployment/old/macos/Dockerfile b/deployment/old/macos/Dockerfile new file mode 100644 index 0000000000..b522df8848 --- /dev/null +++ b/deployment/old/macos/Dockerfile @@ -0,0 +1,37 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/macos +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Install yarn package manager +RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ + && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ + && apt update \ + && apt install -y yarn + +# Link to docker-build script +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/macos/clean.sh b/deployment/old/macos/clean.sh new file mode 100755 index 0000000000..c07501a7bb --- /dev/null +++ b/deployment/old/macos/clean.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +keep_artifacts="${1}" + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-linux-build" + +rm -rf "${package_temporary_dir}" &>/dev/null \ + || sudo rm -rf "${package_temporary_dir}" &>/dev/null + +rm -rf "${output_dir}" &>/dev/null \ + || sudo rm -rf "${output_dir}" &>/dev/null + +if [[ ${keep_artifacts} == 'n' ]]; then + docker_sudo="" + if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo=sudo + fi + ${docker_sudo} docker image rm ${image_name} --force +fi diff --git a/deployment/old/macos/dependencies.txt b/deployment/old/macos/dependencies.txt new file mode 100644 index 0000000000..bdb9670965 --- /dev/null +++ b/deployment/old/macos/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/old/macos/docker-build.sh b/deployment/old/macos/docker-build.sh new file mode 100755 index 0000000000..f9417388d7 --- /dev/null +++ b/deployment/old/macos/docker-build.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Builds the TAR archive inside the Docker container + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Clone down and build Web frontend +web_build_dir="$( mktemp -d )" +web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web" +git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/ +pushd ${web_build_dir} +if [[ -n ${web_branch} ]]; then + checkout -b origin/${web_branch} +fi +yarn install +mkdir -p ${web_target} +mv dist/* ${web_target}/ +popd +rm -rf ${web_build_dir} + +# Get version +version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" + +# Build archives +dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime osx-x64 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true" +tar -cvzf /jellyfin_${version}.portable.tar.gz -C /dist jellyfin_${version} +rm -rf /dist/jellyfin_${version} + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/ +mv /jellyfin[-_]*.tar.gz ${ARTIFACT_DIR}/ +chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/macos/package.sh b/deployment/old/macos/package.sh new file mode 100755 index 0000000000..464c0d382f --- /dev/null +++ b/deployment/old/macos/package.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +args="${@}" +declare -a docker_envvars +for arg in ${args}; do + docker_envvars+=("-e ${arg}") +done + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-macos-build" + +# Determine if sudo should be used for Docker +if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo="sudo" +else + docker_sudo="" +fi + +# Prepare temporary package dir +mkdir -p "${package_temporary_dir}" +# Set up the build environment Docker image +${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile +# Build the DEBs and copy out to ${package_temporary_dir} +${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} +# Move the DEBs to the output directory +mkdir -p "${output_dir}" +mv "${package_temporary_dir}"/* "${output_dir}" diff --git a/deployment/old/portable/Dockerfile b/deployment/old/portable/Dockerfile new file mode 100644 index 0000000000..965eb82b86 --- /dev/null +++ b/deployment/old/portable/Dockerfile @@ -0,0 +1,37 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/portable +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Install yarn package manager +RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ + && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ + && apt update \ + && apt install -y yarn + +# Link to docker-build script +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/portable/clean.sh b/deployment/old/portable/clean.sh new file mode 100755 index 0000000000..c07501a7bb --- /dev/null +++ b/deployment/old/portable/clean.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +keep_artifacts="${1}" + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-linux-build" + +rm -rf "${package_temporary_dir}" &>/dev/null \ + || sudo rm -rf "${package_temporary_dir}" &>/dev/null + +rm -rf "${output_dir}" &>/dev/null \ + || sudo rm -rf "${output_dir}" &>/dev/null + +if [[ ${keep_artifacts} == 'n' ]]; then + docker_sudo="" + if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo=sudo + fi + ${docker_sudo} docker image rm ${image_name} --force +fi diff --git a/deployment/old/portable/dependencies.txt b/deployment/old/portable/dependencies.txt new file mode 100644 index 0000000000..bdb9670965 --- /dev/null +++ b/deployment/old/portable/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/old/portable/docker-build.sh b/deployment/old/portable/docker-build.sh new file mode 100755 index 0000000000..094190bbf6 --- /dev/null +++ b/deployment/old/portable/docker-build.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Builds the TAR archive inside the Docker container + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Clone down and build Web frontend +web_build_dir="$( mktemp -d )" +web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web" +git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/ +pushd ${web_build_dir} +if [[ -n ${web_branch} ]]; then + checkout -b origin/${web_branch} +fi +yarn install +mkdir -p ${web_target} +mv dist/* ${web_target}/ +popd +rm -rf ${web_build_dir} + +# Get version +version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" + +# Build archives +dotnet publish Jellyfin.Server --configuration Release --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" +tar -cvzf /jellyfin_${version}.portable.tar.gz -C /dist jellyfin_${version} +rm -rf /dist/jellyfin_${version} + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/ +mv /jellyfin[-_]*.tar.gz ${ARTIFACT_DIR}/ +chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/portable/package.sh b/deployment/old/portable/package.sh new file mode 100755 index 0000000000..0ceb54dda1 --- /dev/null +++ b/deployment/old/portable/package.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +args="${@}" +declare -a docker_envvars +for arg in ${args}; do + docker_envvars+=("-e ${arg}") +done + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-portable-build" + +# Determine if sudo should be used for Docker +if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo="sudo" +else + docker_sudo="" +fi + +# Prepare temporary package dir +mkdir -p "${package_temporary_dir}" +# Set up the build environment Docker image +${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile +# Build the DEBs and copy out to ${package_temporary_dir} +${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} +# Move the DEBs to the output directory +mkdir -p "${output_dir}" +mv "${package_temporary_dir}"/* "${output_dir}" diff --git a/deployment/old/ubuntu-package-arm64/Dockerfile.amd64 b/deployment/old/ubuntu-package-arm64/Dockerfile.amd64 new file mode 100644 index 0000000000..b11994a18a --- /dev/null +++ b/deployment/old/ubuntu-package-arm64/Dockerfile.amd64 @@ -0,0 +1,59 @@ +FROM ubuntu:bionic +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/ubuntu-package-arm64 +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Install npm package manager +RUN wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ + && echo "deb https://deb.nodesource.com/node_10.x $(lsb_release -s -c) main" > /etc/apt/sources.list.d/npm.list \ + && apt update \ + && apt install -y nodejs + +# Prepare the cross-toolchain +RUN rm /etc/apt/sources.list \ + && export CODENAME="$( lsb_release -c -s )" \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/arm64.list \ + && echo "deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/arm64.list \ + && echo "deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/arm64.list \ + && echo "deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/arm64.list \ + && dpkg --add-architecture arm64 \ + && apt-get update \ + && apt-get install -y cross-gcc-dev \ + && TARGET_LIST="arm64" cross-gcc-gensource 6 \ + && cd cross-gcc-packages-amd64/cross-gcc-6-arm64 \ + && ln -fs /usr/share/zoneinfo/America/Toronto /etc/localtime \ + && apt-get install -y gcc-6-source libstdc++6-arm64-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libcloog-isl-dev libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:arm64 linux-libc-dev:arm64 libgcc1:arm64 libcurl4-openssl-dev:arm64 libfontconfig1-dev:arm64 libfreetype6-dev:arm64 liblttng-ust0:arm64 libstdc++6:arm64 libssl-dev:arm64 + +# Link to docker-build script +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh + +# Link to Debian source dir; mkdir needed or it fails, can't force dest +RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/ubuntu-package-arm64/Dockerfile.arm64 b/deployment/old/ubuntu-package-arm64/Dockerfile.arm64 new file mode 100644 index 0000000000..8f004b2f1a --- /dev/null +++ b/deployment/old/ubuntu-package-arm64/Dockerfile.arm64 @@ -0,0 +1,40 @@ +FROM ubuntu:bionic +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/ubuntu-package-arm64 +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=arm64 + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev liblttng-ust0 libssl-dev + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/5a4c8f96-1c73-401c-a6de-8e100403188a/0ce6ab39747e2508366d498f9c0a0669/dotnet-sdk-3.1.100-linux-arm64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Install npm package manager +RUN wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ + && echo "deb https://deb.nodesource.com/node_10.x $(lsb_release -s -c) main" > /etc/apt/sources.list.d/npm.list \ + && apt update \ + && apt install -y nodejs + +# Link to docker-build script +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh + +# Link to Debian source dir; mkdir needed or it fails, can't force dest +RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/ubuntu-package-arm64/clean.sh b/deployment/old/ubuntu-package-arm64/clean.sh new file mode 100755 index 0000000000..82d427f9e5 --- /dev/null +++ b/deployment/old/ubuntu-package-arm64/clean.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +keep_artifacts="${1}" + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-ubuntu-build" + +rm -rf "${package_temporary_dir}" &>/dev/null \ + || sudo rm -rf "${package_temporary_dir}" &>/dev/null + +rm -rf "${output_dir}" &>/dev/null \ + || sudo rm -rf "${output_dir}" &>/dev/null + +if [[ ${keep_artifacts} == 'n' ]]; then + docker_sudo="" + if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo=sudo + fi + ${docker_sudo} docker image rm ${image_name} --force +fi diff --git a/deployment/old/ubuntu-package-arm64/dependencies.txt b/deployment/old/ubuntu-package-arm64/dependencies.txt new file mode 100644 index 0000000000..bdb9670965 --- /dev/null +++ b/deployment/old/ubuntu-package-arm64/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/old/ubuntu-package-arm64/docker-build.sh b/deployment/old/ubuntu-package-arm64/docker-build.sh new file mode 100755 index 0000000000..67ab6bd74b --- /dev/null +++ b/deployment/old/ubuntu-package-arm64/docker-build.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Builds the DEB inside the Docker container + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image +sed -i '/dotnet-sdk-3.1,/d' debian/control + +# Build DEB +export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} +dpkg-buildpackage -us -uc -aarm64 + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/deb +mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ +chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/ubuntu-package-arm64/package.sh b/deployment/old/ubuntu-package-arm64/package.sh new file mode 100755 index 0000000000..d1140a7274 --- /dev/null +++ b/deployment/old/ubuntu-package-arm64/package.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +args="${@}" +declare -a docker_envvars +for arg in ${args}; do + docker_envvars+=("-e ${arg}") +done + +ARCH="$( arch )" +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-ubuntu_arm64-build" + +# Determine if sudo should be used for Docker +if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo="sudo" +else + docker_sudo="" +fi + +# Determine which Dockerfile to use +case $ARCH in + 'x86_64') + DOCKERFILE="Dockerfile.amd64" + ;; + 'armv7l') + DOCKERFILE="Dockerfile.arm64" + ;; +esac + +# Prepare temporary package dir +mkdir -p "${package_temporary_dir}" +# Set up the build environment Docker image +${docker_sudo} docker build ../.. -t "${image_name}" -f ./${DOCKERFILE} +# Build the DEBs and copy out to ${package_temporary_dir} +${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} +# Move the DEBs to the output directory +mkdir -p "${output_dir}" +mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/ubuntu-package-arm64/pkg-src b/deployment/old/ubuntu-package-arm64/pkg-src new file mode 120000 index 0000000000..4c695fea17 --- /dev/null +++ b/deployment/old/ubuntu-package-arm64/pkg-src @@ -0,0 +1 @@ +../debian-package-x64/pkg-src \ No newline at end of file diff --git a/deployment/old/ubuntu-package-armhf/Dockerfile.amd64 b/deployment/old/ubuntu-package-armhf/Dockerfile.amd64 new file mode 100644 index 0000000000..e475b14389 --- /dev/null +++ b/deployment/old/ubuntu-package-armhf/Dockerfile.amd64 @@ -0,0 +1,59 @@ +FROM ubuntu:bionic +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/ubuntu-package-armhf +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Install npm package manager +RUN wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ + && echo "deb https://deb.nodesource.com/node_10.x $(lsb_release -s -c) main" > /etc/apt/sources.list.d/npm.list \ + && apt update \ + && apt install -y nodejs + +# Prepare the cross-toolchain +RUN rm /etc/apt/sources.list \ + && export CODENAME="$( lsb_release -c -s )" \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/armhf.list \ + && echo "deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/armhf.list \ + && echo "deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/armhf.list \ + && echo "deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/armhf.list \ + && dpkg --add-architecture armhf \ + && apt-get update \ + && apt-get install -y cross-gcc-dev \ + && TARGET_LIST="armhf" cross-gcc-gensource 6 \ + && cd cross-gcc-packages-amd64/cross-gcc-6-armhf \ + && ln -fs /usr/share/zoneinfo/America/Toronto /etc/localtime \ + && apt-get install -y gcc-6-source libstdc++6-armhf-cross binutils-arm-linux-gnueabihf bison flex libtool gdb sharutils netbase libcloog-isl-dev libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:armhf linux-libc-dev:armhf libgcc1:armhf libcurl4-openssl-dev:armhf libfontconfig1-dev:armhf libfreetype6-dev:armhf liblttng-ust0:armhf libstdc++6:armhf libssl-dev:armhf + +# Link to docker-build script +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh + +# Link to Debian source dir; mkdir needed or it fails, can't force dest +RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/ubuntu-package-armhf/Dockerfile.armhf b/deployment/old/ubuntu-package-armhf/Dockerfile.armhf new file mode 100644 index 0000000000..0e71fa6938 --- /dev/null +++ b/deployment/old/ubuntu-package-armhf/Dockerfile.armhf @@ -0,0 +1,40 @@ +FROM ubuntu:bionic +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/ubuntu-package-armhf +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=armhf + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev liblttng-ust0 libssl-dev + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/67766a96-eb8c-4cd2-bca4-ea63d2cc115c/7bf13840aa2ed88793b7315d5e0d74e6/dotnet-sdk-3.1.100-linux-arm.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Install npm package manager +RUN wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ + && echo "deb https://deb.nodesource.com/node_10.x $(lsb_release -s -c) main" > /etc/apt/sources.list.d/npm.list \ + && apt update \ + && apt install -y nodejs + +# Link to docker-build script +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh + +# Link to Debian source dir; mkdir needed or it fails, can't force dest +RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/ubuntu-package-armhf/clean.sh b/deployment/old/ubuntu-package-armhf/clean.sh new file mode 100755 index 0000000000..82d427f9e5 --- /dev/null +++ b/deployment/old/ubuntu-package-armhf/clean.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +keep_artifacts="${1}" + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-ubuntu-build" + +rm -rf "${package_temporary_dir}" &>/dev/null \ + || sudo rm -rf "${package_temporary_dir}" &>/dev/null + +rm -rf "${output_dir}" &>/dev/null \ + || sudo rm -rf "${output_dir}" &>/dev/null + +if [[ ${keep_artifacts} == 'n' ]]; then + docker_sudo="" + if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo=sudo + fi + ${docker_sudo} docker image rm ${image_name} --force +fi diff --git a/deployment/old/ubuntu-package-armhf/dependencies.txt b/deployment/old/ubuntu-package-armhf/dependencies.txt new file mode 100644 index 0000000000..bdb9670965 --- /dev/null +++ b/deployment/old/ubuntu-package-armhf/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/old/ubuntu-package-armhf/docker-build.sh b/deployment/old/ubuntu-package-armhf/docker-build.sh new file mode 100755 index 0000000000..1bd7fb2911 --- /dev/null +++ b/deployment/old/ubuntu-package-armhf/docker-build.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Builds the DEB inside the Docker container + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image +sed -i '/dotnet-sdk-3.1,/d' debian/control + +# Build DEB +export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} +dpkg-buildpackage -us -uc -aarmhf + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/deb +mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ +chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/ubuntu-package-armhf/package.sh b/deployment/old/ubuntu-package-armhf/package.sh new file mode 100755 index 0000000000..2ceb3e8165 --- /dev/null +++ b/deployment/old/ubuntu-package-armhf/package.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +args="${@}" +declare -a docker_envvars +for arg in ${args}; do + docker_envvars+=("-e ${arg}") +done + +ARCH="$( arch )" +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-ubuntu_armhf-build" + +# Determine if sudo should be used for Docker +if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo="sudo" +else + docker_sudo="" +fi + +# Determine which Dockerfile to use +case $ARCH in + 'x86_64') + DOCKERFILE="Dockerfile.amd64" + ;; + 'armv7l') + DOCKERFILE="Dockerfile.armhf" + ;; +esac + +# Prepare temporary package dir +mkdir -p "${package_temporary_dir}" +# Set up the build environment Docker image +${docker_sudo} docker build ../.. -t "${image_name}" -f ./${DOCKERFILE} +# Build the DEBs and copy out to ${package_temporary_dir} +${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} +# Move the DEBs to the output directory +mkdir -p "${output_dir}" +mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/ubuntu-package-armhf/pkg-src b/deployment/old/ubuntu-package-armhf/pkg-src new file mode 120000 index 0000000000..4c695fea17 --- /dev/null +++ b/deployment/old/ubuntu-package-armhf/pkg-src @@ -0,0 +1 @@ +../debian-package-x64/pkg-src \ No newline at end of file diff --git a/deployment/old/ubuntu-package-x64/Dockerfile b/deployment/old/ubuntu-package-x64/Dockerfile new file mode 100644 index 0000000000..e2dda6392c --- /dev/null +++ b/deployment/old/ubuntu-package-x64/Dockerfile @@ -0,0 +1,36 @@ +FROM ubuntu:bionic +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/ubuntu-package-x64 +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 + +# Prepare Ubuntu build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev liblttng-ust0 \ + && ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh \ + && mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Install npm package manager +RUN wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ + && echo "deb https://deb.nodesource.com/node_10.x $(lsb_release -s -c) main" > /etc/apt/sources.list.d/npm.list \ + && apt update \ + && apt install -y nodejs + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/ubuntu-package-x64/clean.sh b/deployment/old/ubuntu-package-x64/clean.sh new file mode 100755 index 0000000000..82d427f9e5 --- /dev/null +++ b/deployment/old/ubuntu-package-x64/clean.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +keep_artifacts="${1}" + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-ubuntu-build" + +rm -rf "${package_temporary_dir}" &>/dev/null \ + || sudo rm -rf "${package_temporary_dir}" &>/dev/null + +rm -rf "${output_dir}" &>/dev/null \ + || sudo rm -rf "${output_dir}" &>/dev/null + +if [[ ${keep_artifacts} == 'n' ]]; then + docker_sudo="" + if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo=sudo + fi + ${docker_sudo} docker image rm ${image_name} --force +fi diff --git a/deployment/old/ubuntu-package-x64/dependencies.txt b/deployment/old/ubuntu-package-x64/dependencies.txt new file mode 100644 index 0000000000..bdb9670965 --- /dev/null +++ b/deployment/old/ubuntu-package-x64/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/old/ubuntu-package-x64/docker-build.sh b/deployment/old/ubuntu-package-x64/docker-build.sh new file mode 100755 index 0000000000..962a522ebc --- /dev/null +++ b/deployment/old/ubuntu-package-x64/docker-build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Builds the DEB inside the Docker container + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image +sed -i '/dotnet-sdk-3.1,/d' debian/control + +# Build DEB +dpkg-buildpackage -us -uc + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/deb +mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ +chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/ubuntu-package-x64/package.sh b/deployment/old/ubuntu-package-x64/package.sh new file mode 100755 index 0000000000..08c003778b --- /dev/null +++ b/deployment/old/ubuntu-package-x64/package.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +args="${@}" +declare -a docker_envvars +for arg in ${args}; do + docker_envvars+=("-e ${arg}") +done + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-ubuntu-build" + +# Determine if sudo should be used for Docker +if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo="sudo" +else + docker_sudo="" +fi + +# Prepare temporary package dir +mkdir -p "${package_temporary_dir}" +# Set up the build environment Docker image +${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile +# Build the DEBs and copy out to ${package_temporary_dir} +${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} +# Move the DEBs to the output directory +mkdir -p "${output_dir}" +mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/ubuntu-package-x64/pkg-src b/deployment/old/ubuntu-package-x64/pkg-src new file mode 120000 index 0000000000..0bb6d55249 --- /dev/null +++ b/deployment/old/ubuntu-package-x64/pkg-src @@ -0,0 +1 @@ +../debian-package-x64/pkg-src/ \ No newline at end of file diff --git a/deployment/old/unraid/docker-templates/README.md b/deployment/old/unraid/docker-templates/README.md new file mode 100644 index 0000000000..2c268e8b3e --- /dev/null +++ b/deployment/old/unraid/docker-templates/README.md @@ -0,0 +1,15 @@ +# docker-templates + +### Installation: + +Open unRaid GUI (at least unRaid 6.5) + +Click on the Docker tab + +Add the following line under "Template Repositories" + +https://github.com/jellyfin/jellyfin/blob/master/deployment/unraid/docker-templates + +Click save than click on Add Container and select jellyfin. + +Adjust to your paths to your liking and off you go! diff --git a/deployment/old/unraid/docker-templates/jellyfin.xml b/deployment/old/unraid/docker-templates/jellyfin.xml new file mode 100644 index 0000000000..57b4cc5ae1 --- /dev/null +++ b/deployment/old/unraid/docker-templates/jellyfin.xml @@ -0,0 +1,57 @@ + + + https://raw.githubusercontent.com/jellyfin/jellyfin/deployment/unraid/docker-templates/jellyfin.xml + False + MediaApp:Video MediaApp:Music MediaApp:Photos MediaServer:Video MediaServer:Music MediaServer:Photos + Jellyfin + + Jellyfin is The Free Software Media Browser Converted By Community Applications Always verify this template (and values) against the dockerhub support page for the container!![br][br] + You can add as many mount points as needed for recordings, movies ,etc. [br][br] + [b][span style='color: #E80000;']Directions:[/span][/b][br] + [b]/config[/b] : This is where Jellyfin will store it's databases and configuration.[br][br] + [b]Port[/b] : This is the default port for Jellyfin. (Will add ssl port later)[br][br] + [b]Media[/b] : This is the mounting point of your media. When you access it in Jellyfin it will be /media or whatever you chose for a mount point[br][br] + [b]Cache[/b] : This is where Jellyfin will store and manage cached files like images to serve to clients. This is not where all images are stored.[br][br] + [b]Tip:[/b] You can add more volume mappings if you wish Jellyfin has access to it. + + + Jellyfin Server is a home media server built on top of other popular open source technologies such as Service Stack, jQuery, jQuery mobile, and Mono and will remain completely free! + + https://www.reddit.com/r/jellyfin/ + https://hub.docker.com/r/jellyfin/jellyfin/ + https://github.com/jellyfin/jellyfin/> + jellyfin/jellyfin + https://jellyfin.media/ + true + false + + host + + + 8096 + 8096 + tcp + + + + + + /mnt/user/appdata/Jellyfin + /config + rw + + + /mnt/user + /media + rw + + + /mnt/user/appdata/Jellyfin/cache/ + /cache + rw + + + http://[IP]:[PORT:8096]/ + https://raw.githubusercontent.com/binhex/docker-templates/master/binhex/images/jellyfin-icon.png + + diff --git a/deployment/old/win-x64/Dockerfile b/deployment/old/win-x64/Dockerfile new file mode 100644 index 0000000000..8a33749541 --- /dev/null +++ b/deployment/old/win-x64/Dockerfile @@ -0,0 +1,37 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/win-x64 +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 zip + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Install yarn package manager +RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ + && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ + && apt update \ + && apt install -y yarn + +# Link to docker-build script +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/win-x64/clean.sh b/deployment/old/win-x64/clean.sh new file mode 100755 index 0000000000..6c183f3371 --- /dev/null +++ b/deployment/old/win-x64/clean.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +keep_artifacts="${1}" + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-windows-x64-build" + +rm -rf "${package_temporary_dir}" &>/dev/null \ + || sudo rm -rf "${package_temporary_dir}" &>/dev/null + +rm -rf "${output_dir}" &>/dev/null \ + || sudo rm -rf "${output_dir}" &>/dev/null + +if [[ ${keep_artifacts} == 'n' ]]; then + docker_sudo="" + if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo=sudo + fi + ${docker_sudo} docker image rm ${image_name} --force +fi diff --git a/deployment/old/win-x64/dependencies.txt b/deployment/old/win-x64/dependencies.txt new file mode 100644 index 0000000000..bdb9670965 --- /dev/null +++ b/deployment/old/win-x64/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/old/win-x64/docker-build.sh b/deployment/old/win-x64/docker-build.sh new file mode 100755 index 0000000000..79e5fb0bcd --- /dev/null +++ b/deployment/old/win-x64/docker-build.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +# Builds the ZIP archive inside the Docker container + +set -o errexit +set -o xtrace + +# Version variables +NSSM_VERSION="nssm-2.24-101-g897c7ad" +NSSM_URL="http://files.evilt.win/nssm/${NSSM_VERSION}.zip" +FFMPEG_VERSION="ffmpeg-4.2.1-win64-static" +FFMPEG_URL="https://ffmpeg.zeranoe.com/builds/win64/static/${FFMPEG_VERSION}.zip" + +# Move to source directory +pushd ${SOURCE_DIR} + +# Clone down and build Web frontend +web_build_dir="$( mktemp -d )" +web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web" +git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/ +pushd ${web_build_dir} +if [[ -n ${web_branch} ]]; then + checkout -b origin/${web_branch} +fi +yarn install +mkdir -p ${web_target} +mv dist/* ${web_target}/ +popd +rm -rf ${web_build_dir} + +# Get version +version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" + +# Build binary +dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime win-x64 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true" + +# Prepare addins +addin_build_dir="$( mktemp -d )" +wget ${NSSM_URL} -O ${addin_build_dir}/nssm.zip +wget ${FFMPEG_URL} -O ${addin_build_dir}/ffmpeg.zip +unzip ${addin_build_dir}/nssm.zip -d ${addin_build_dir} +cp ${addin_build_dir}/${NSSM_VERSION}/win64/nssm.exe /dist/jellyfin_${version}/nssm.exe +unzip ${addin_build_dir}/ffmpeg.zip -d ${addin_build_dir} +cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffmpeg.exe /dist/jellyfin_${version}/ffmpeg.exe +cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffprobe.exe /dist/jellyfin_${version}/ffprobe.exe +rm -rf ${addin_build_dir} + +# Prepare scripts +cp ${SOURCE_DIR}/deployment/windows/legacy/install-jellyfin.ps1 /dist/jellyfin_${version}/install-jellyfin.ps1 +cp ${SOURCE_DIR}/deployment/windows/legacy/install.bat /dist/jellyfin_${version}/install.bat + +# Create zip package +pushd /dist +zip -r /jellyfin_${version}.portable.zip jellyfin_${version} +popd +rm -rf /dist/jellyfin_${version} + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/ +mv /jellyfin[-_]*.zip ${ARTIFACT_DIR}/ +chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/win-x64/package.sh b/deployment/old/win-x64/package.sh new file mode 100755 index 0000000000..a8ab190fa5 --- /dev/null +++ b/deployment/old/win-x64/package.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +args="${@}" +declare -a docker_envvars +for arg in ${args}; do + docker_envvars+=("-e ${arg}") +done + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-windows-x64-build" + +# Determine if sudo should be used for Docker +if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo="sudo" +else + docker_sudo="" +fi + +# Prepare temporary package dir +mkdir -p "${package_temporary_dir}" +# Set up the build environment Docker image +${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile +# Build the DEBs and copy out to ${package_temporary_dir} +${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} +# Move the DEBs to the output directory +mkdir -p "${output_dir}" +mv "${package_temporary_dir}"/* "${output_dir}" diff --git a/deployment/old/win-x86/Dockerfile b/deployment/old/win-x86/Dockerfile new file mode 100644 index 0000000000..f8dc5be83d --- /dev/null +++ b/deployment/old/win-x86/Dockerfile @@ -0,0 +1,37 @@ +FROM debian:10 +# Docker build arguments +ARG SOURCE_DIR=/jellyfin +ARG PLATFORM_DIR=/jellyfin/deployment/win-x86 +ARG ARTIFACT_DIR=/dist +ARG SDK_VERSION=3.1 +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV ARCH=amd64 + +# Prepare Debian build environment +RUN apt-get update \ + && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 zip + +# Install dotnet repository +# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current +RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ + && mkdir -p dotnet-sdk \ + && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ + && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet + +# Install yarn package manager +RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ + && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ + && apt update \ + && apt install -y yarn + +# Link to docker-build script +RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh + +VOLUME ${ARTIFACT_DIR}/ + +COPY . ${SOURCE_DIR}/ + +ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/win-x86/clean.sh b/deployment/old/win-x86/clean.sh new file mode 100755 index 0000000000..8b78c5e4b6 --- /dev/null +++ b/deployment/old/win-x86/clean.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +keep_artifacts="${1}" + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-windows-x86-build" + +rm -rf "${package_temporary_dir}" &>/dev/null \ + || sudo rm -rf "${package_temporary_dir}" &>/dev/null + +rm -rf "${output_dir}" &>/dev/null \ + || sudo rm -rf "${output_dir}" &>/dev/null + +if [[ ${keep_artifacts} == 'n' ]]; then + docker_sudo="" + if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo=sudo + fi + ${docker_sudo} docker image rm ${image_name} --force +fi diff --git a/deployment/old/win-x86/dependencies.txt b/deployment/old/win-x86/dependencies.txt new file mode 100644 index 0000000000..bdb9670965 --- /dev/null +++ b/deployment/old/win-x86/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/old/win-x86/docker-build.sh b/deployment/old/win-x86/docker-build.sh new file mode 100755 index 0000000000..977dcf78fa --- /dev/null +++ b/deployment/old/win-x86/docker-build.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +# Builds the ZIP archive inside the Docker container + +set -o errexit +set -o xtrace + +# Version variables +NSSM_VERSION="nssm-2.24-101-g897c7ad" +NSSM_URL="http://files.evilt.win/nssm/${NSSM_VERSION}.zip" +FFMPEG_VERSION="ffmpeg-4.2.1-win32-static" +FFMPEG_URL="https://ffmpeg.zeranoe.com/builds/win32/static/${FFMPEG_VERSION}.zip" + +# Move to source directory +pushd ${SOURCE_DIR} + +# Clone down and build Web frontend +web_build_dir="$( mktemp -d )" +web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web" +git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/ +pushd ${web_build_dir} +if [[ -n ${web_branch} ]]; then + checkout -b origin/${web_branch} +fi +yarn install +mkdir -p ${web_target} +mv dist/* ${web_target}/ +popd +rm -rf ${web_build_dir} + +# Get version +version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" + +# Build binary +dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime win-x86 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true" + +# Prepare addins +addin_build_dir="$( mktemp -d )" +wget ${NSSM_URL} -O ${addin_build_dir}/nssm.zip +wget ${FFMPEG_URL} -O ${addin_build_dir}/ffmpeg.zip +unzip ${addin_build_dir}/nssm.zip -d ${addin_build_dir} +cp ${addin_build_dir}/${NSSM_VERSION}/win64/nssm.exe /dist/jellyfin_${version}/nssm.exe +unzip ${addin_build_dir}/ffmpeg.zip -d ${addin_build_dir} +cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffmpeg.exe /dist/jellyfin_${version}/ffmpeg.exe +cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffprobe.exe /dist/jellyfin_${version}/ffprobe.exe +rm -rf ${addin_build_dir} + +# Prepare scripts +cp ${SOURCE_DIR}/deployment/windows/legacy/install-jellyfin.ps1 /dist/jellyfin_${version}/install-jellyfin.ps1 +cp ${SOURCE_DIR}/deployment/windows/legacy/install.bat /dist/jellyfin_${version}/install.bat + +# Create zip package +pushd /dist +zip -r /jellyfin_${version}.portable.zip jellyfin_${version} +popd +rm -rf /dist/jellyfin_${version} + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/ +mv /jellyfin[-_]*.zip ${ARTIFACT_DIR}/ +chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/win-x86/package.sh b/deployment/old/win-x86/package.sh new file mode 100755 index 0000000000..65e7e2928c --- /dev/null +++ b/deployment/old/win-x86/package.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +args="${@}" +declare -a docker_envvars +for arg in ${args}; do + docker_envvars+=("-e ${arg}") +done + +WORKDIR="$( pwd )" + +package_temporary_dir="${WORKDIR}/pkg-dist-tmp" +output_dir="${WORKDIR}/pkg-dist" +current_user="$( whoami )" +image_name="jellyfin-windows-x86-build" + +# Determine if sudo should be used for Docker +if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ + && [[ ! ${EUID:-1000} -eq 0 ]] \ + && [[ ! ${USER} == "root" ]] \ + && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then + docker_sudo="sudo" +else + docker_sudo="" +fi + +# Prepare temporary package dir +mkdir -p "${package_temporary_dir}" +# Set up the build environment Docker image +${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile +# Build the DEBs and copy out to ${package_temporary_dir} +${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} +# Move the DEBs to the output directory +mkdir -p "${output_dir}" +mv "${package_temporary_dir}"/* "${output_dir}" From 42813ef06973126151e2c91ecb7aa6836e0d472c Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 9 Apr 2020 11:50:32 -0400 Subject: [PATCH 049/115] Preserve Unraid configuration --- deployment/unraid/docker-templates/README.md | 15 +++++ .../unraid/docker-templates/jellyfin.xml | 57 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 deployment/unraid/docker-templates/README.md create mode 100644 deployment/unraid/docker-templates/jellyfin.xml diff --git a/deployment/unraid/docker-templates/README.md b/deployment/unraid/docker-templates/README.md new file mode 100644 index 0000000000..2c268e8b3e --- /dev/null +++ b/deployment/unraid/docker-templates/README.md @@ -0,0 +1,15 @@ +# docker-templates + +### Installation: + +Open unRaid GUI (at least unRaid 6.5) + +Click on the Docker tab + +Add the following line under "Template Repositories" + +https://github.com/jellyfin/jellyfin/blob/master/deployment/unraid/docker-templates + +Click save than click on Add Container and select jellyfin. + +Adjust to your paths to your liking and off you go! diff --git a/deployment/unraid/docker-templates/jellyfin.xml b/deployment/unraid/docker-templates/jellyfin.xml new file mode 100644 index 0000000000..57b4cc5ae1 --- /dev/null +++ b/deployment/unraid/docker-templates/jellyfin.xml @@ -0,0 +1,57 @@ + + + https://raw.githubusercontent.com/jellyfin/jellyfin/deployment/unraid/docker-templates/jellyfin.xml + False + MediaApp:Video MediaApp:Music MediaApp:Photos MediaServer:Video MediaServer:Music MediaServer:Photos + Jellyfin + + Jellyfin is The Free Software Media Browser Converted By Community Applications Always verify this template (and values) against the dockerhub support page for the container!![br][br] + You can add as many mount points as needed for recordings, movies ,etc. [br][br] + [b][span style='color: #E80000;']Directions:[/span][/b][br] + [b]/config[/b] : This is where Jellyfin will store it's databases and configuration.[br][br] + [b]Port[/b] : This is the default port for Jellyfin. (Will add ssl port later)[br][br] + [b]Media[/b] : This is the mounting point of your media. When you access it in Jellyfin it will be /media or whatever you chose for a mount point[br][br] + [b]Cache[/b] : This is where Jellyfin will store and manage cached files like images to serve to clients. This is not where all images are stored.[br][br] + [b]Tip:[/b] You can add more volume mappings if you wish Jellyfin has access to it. + + + Jellyfin Server is a home media server built on top of other popular open source technologies such as Service Stack, jQuery, jQuery mobile, and Mono and will remain completely free! + + https://www.reddit.com/r/jellyfin/ + https://hub.docker.com/r/jellyfin/jellyfin/ + https://github.com/jellyfin/jellyfin/> + jellyfin/jellyfin + https://jellyfin.media/ + true + false + + host + + + 8096 + 8096 + tcp + + + + + + /mnt/user/appdata/Jellyfin + /config + rw + + + /mnt/user + /media + rw + + + /mnt/user/appdata/Jellyfin/cache/ + /cache + rw + + + http://[IP]:[PORT:8096]/ + https://raw.githubusercontent.com/binhex/docker-templates/master/binhex/images/jellyfin-icon.png + + From fbad4f00b4a95b889708d430ad445a58dad2f964 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 9 Apr 2020 11:50:46 -0400 Subject: [PATCH 050/115] Remove old build infra (again) --- deployment/old/README.md | 62 ------ deployment/old/centos-package-x64/Dockerfile | 39 ---- deployment/old/centos-package-x64/clean.sh | 32 ---- .../old/centos-package-x64/dependencies.txt | 1 - .../old/centos-package-x64/docker-build.sh | 18 -- deployment/old/centos-package-x64/package.sh | 34 ---- deployment/old/centos-package-x64/pkg-src | 1 - .../old/debian-package-arm64/Dockerfile.amd64 | 43 ----- .../old/debian-package-arm64/Dockerfile.arm64 | 34 ---- deployment/old/debian-package-arm64/clean.sh | 27 --- .../old/debian-package-arm64/dependencies.txt | 1 - .../old/debian-package-arm64/docker-build.sh | 21 -- .../old/debian-package-arm64/package.sh | 45 ----- deployment/old/debian-package-arm64/pkg-src | 1 - .../old/debian-package-armhf/Dockerfile.amd64 | 42 ---- .../old/debian-package-armhf/Dockerfile.armhf | 34 ---- deployment/old/debian-package-armhf/clean.sh | 27 --- .../old/debian-package-armhf/dependencies.txt | 1 - .../old/debian-package-armhf/docker-build.sh | 21 -- .../old/debian-package-armhf/package.sh | 45 ----- deployment/old/debian-package-armhf/pkg-src | 1 - deployment/old/debian-package-x64/Dockerfile | 34 ---- deployment/old/debian-package-x64/clean.sh | 27 --- .../old/debian-package-x64/dependencies.txt | 1 - .../old/debian-package-x64/docker-build.sh | 20 -- deployment/old/debian-package-x64/package.sh | 34 ---- .../old/debian-package-x64/pkg-src/changelog | 59 ------ .../old/debian-package-x64/pkg-src/compat | 1 - .../debian-package-x64/pkg-src/conf/jellyfin | 40 ---- .../pkg-src/conf/jellyfin-sudoers | 37 ---- .../pkg-src/conf/jellyfin.service.conf | 7 - .../pkg-src/conf/logging.json | 30 --- .../old/debian-package-x64/pkg-src/control | 31 --- .../old/debian-package-x64/pkg-src/copyright | 29 --- .../old/debian-package-x64/pkg-src/gbp.conf | 6 - .../old/debian-package-x64/pkg-src/install | 6 - .../debian-package-x64/pkg-src/jellyfin.init | 61 ------ .../pkg-src/jellyfin.service | 14 -- .../pkg-src/jellyfin.upstart | 20 -- .../debian-package-x64/pkg-src/po/POTFILES.in | 1 - .../pkg-src/po/templates.pot | 57 ------ .../old/debian-package-x64/pkg-src/postinst | 92 --------- .../old/debian-package-x64/pkg-src/postrm | 81 -------- .../old/debian-package-x64/pkg-src/preinst | 78 -------- .../old/debian-package-x64/pkg-src/prerm | 61 ------ .../old/debian-package-x64/pkg-src/rules | 66 ------- .../pkg-src/source.lintian-overrides | 3 - .../debian-package-x64/pkg-src/source/format | 1 - .../debian-package-x64/pkg-src/source/options | 11 -- deployment/old/fedora-package-x64/Dockerfile | 33 ---- deployment/old/fedora-package-x64/clean.sh | 32 ---- .../old/fedora-package-x64/dependencies.txt | 1 - .../old/fedora-package-x64/docker-build.sh | 18 -- deployment/old/fedora-package-x64/package.sh | 34 ---- .../old/fedora-package-x64/pkg-src/.gitignore | 3 - .../old/fedora-package-x64/pkg-src/README.md | 43 ----- .../pkg-src/jellyfin-firewalld.xml | 9 - .../fedora-package-x64/pkg-src/jellyfin.env | 34 ---- .../pkg-src/jellyfin.override.conf | 7 - .../pkg-src/jellyfin.service | 15 -- .../fedora-package-x64/pkg-src/jellyfin.spec | 181 ------------------ .../pkg-src/jellyfin.sudoers | 19 -- .../old/fedora-package-x64/pkg-src/restart.sh | 36 ---- deployment/old/linux-x64/Dockerfile | 37 ---- deployment/old/linux-x64/clean.sh | 27 --- deployment/old/linux-x64/dependencies.txt | 1 - deployment/old/linux-x64/docker-build.sh | 36 ---- deployment/old/linux-x64/package.sh | 34 ---- deployment/old/macos/Dockerfile | 37 ---- deployment/old/macos/clean.sh | 27 --- deployment/old/macos/dependencies.txt | 1 - deployment/old/macos/docker-build.sh | 36 ---- deployment/old/macos/package.sh | 34 ---- deployment/old/portable/Dockerfile | 37 ---- deployment/old/portable/clean.sh | 27 --- deployment/old/portable/dependencies.txt | 1 - deployment/old/portable/docker-build.sh | 36 ---- deployment/old/portable/package.sh | 34 ---- .../old/ubuntu-package-arm64/Dockerfile.amd64 | 59 ------ .../old/ubuntu-package-arm64/Dockerfile.arm64 | 40 ---- deployment/old/ubuntu-package-arm64/clean.sh | 27 --- .../old/ubuntu-package-arm64/dependencies.txt | 1 - .../old/ubuntu-package-arm64/docker-build.sh | 21 -- .../old/ubuntu-package-arm64/package.sh | 45 ----- deployment/old/ubuntu-package-arm64/pkg-src | 1 - .../old/ubuntu-package-armhf/Dockerfile.amd64 | 59 ------ .../old/ubuntu-package-armhf/Dockerfile.armhf | 40 ---- deployment/old/ubuntu-package-armhf/clean.sh | 27 --- .../old/ubuntu-package-armhf/dependencies.txt | 1 - .../old/ubuntu-package-armhf/docker-build.sh | 21 -- .../old/ubuntu-package-armhf/package.sh | 45 ----- deployment/old/ubuntu-package-armhf/pkg-src | 1 - deployment/old/ubuntu-package-x64/Dockerfile | 36 ---- deployment/old/ubuntu-package-x64/clean.sh | 27 --- .../old/ubuntu-package-x64/dependencies.txt | 1 - .../old/ubuntu-package-x64/docker-build.sh | 20 -- deployment/old/ubuntu-package-x64/package.sh | 34 ---- deployment/old/ubuntu-package-x64/pkg-src | 1 - .../old/unraid/docker-templates/README.md | 15 -- .../old/unraid/docker-templates/jellyfin.xml | 57 ------ deployment/old/win-x64/Dockerfile | 37 ---- deployment/old/win-x64/clean.sh | 27 --- deployment/old/win-x64/dependencies.txt | 1 - deployment/old/win-x64/docker-build.sh | 61 ------ deployment/old/win-x64/package.sh | 34 ---- deployment/old/win-x86/Dockerfile | 37 ---- deployment/old/win-x86/clean.sh | 27 --- deployment/old/win-x86/dependencies.txt | 1 - deployment/old/win-x86/docker-build.sh | 61 ------ deployment/old/win-x86/package.sh | 34 ---- 110 files changed, 3207 deletions(-) delete mode 100644 deployment/old/README.md delete mode 100644 deployment/old/centos-package-x64/Dockerfile delete mode 100755 deployment/old/centos-package-x64/clean.sh delete mode 100644 deployment/old/centos-package-x64/dependencies.txt delete mode 100755 deployment/old/centos-package-x64/docker-build.sh delete mode 100755 deployment/old/centos-package-x64/package.sh delete mode 120000 deployment/old/centos-package-x64/pkg-src delete mode 100644 deployment/old/debian-package-arm64/Dockerfile.amd64 delete mode 100644 deployment/old/debian-package-arm64/Dockerfile.arm64 delete mode 100755 deployment/old/debian-package-arm64/clean.sh delete mode 100644 deployment/old/debian-package-arm64/dependencies.txt delete mode 100755 deployment/old/debian-package-arm64/docker-build.sh delete mode 100755 deployment/old/debian-package-arm64/package.sh delete mode 120000 deployment/old/debian-package-arm64/pkg-src delete mode 100644 deployment/old/debian-package-armhf/Dockerfile.amd64 delete mode 100644 deployment/old/debian-package-armhf/Dockerfile.armhf delete mode 100755 deployment/old/debian-package-armhf/clean.sh delete mode 100644 deployment/old/debian-package-armhf/dependencies.txt delete mode 100755 deployment/old/debian-package-armhf/docker-build.sh delete mode 100755 deployment/old/debian-package-armhf/package.sh delete mode 120000 deployment/old/debian-package-armhf/pkg-src delete mode 100644 deployment/old/debian-package-x64/Dockerfile delete mode 100755 deployment/old/debian-package-x64/clean.sh delete mode 100644 deployment/old/debian-package-x64/dependencies.txt delete mode 100755 deployment/old/debian-package-x64/docker-build.sh delete mode 100755 deployment/old/debian-package-x64/package.sh delete mode 100644 deployment/old/debian-package-x64/pkg-src/changelog delete mode 100644 deployment/old/debian-package-x64/pkg-src/compat delete mode 100644 deployment/old/debian-package-x64/pkg-src/conf/jellyfin delete mode 100644 deployment/old/debian-package-x64/pkg-src/conf/jellyfin-sudoers delete mode 100644 deployment/old/debian-package-x64/pkg-src/conf/jellyfin.service.conf delete mode 100644 deployment/old/debian-package-x64/pkg-src/conf/logging.json delete mode 100644 deployment/old/debian-package-x64/pkg-src/control delete mode 100644 deployment/old/debian-package-x64/pkg-src/copyright delete mode 100644 deployment/old/debian-package-x64/pkg-src/gbp.conf delete mode 100644 deployment/old/debian-package-x64/pkg-src/install delete mode 100644 deployment/old/debian-package-x64/pkg-src/jellyfin.init delete mode 100644 deployment/old/debian-package-x64/pkg-src/jellyfin.service delete mode 100644 deployment/old/debian-package-x64/pkg-src/jellyfin.upstart delete mode 100644 deployment/old/debian-package-x64/pkg-src/po/POTFILES.in delete mode 100644 deployment/old/debian-package-x64/pkg-src/po/templates.pot delete mode 100644 deployment/old/debian-package-x64/pkg-src/postinst delete mode 100644 deployment/old/debian-package-x64/pkg-src/postrm delete mode 100644 deployment/old/debian-package-x64/pkg-src/preinst delete mode 100644 deployment/old/debian-package-x64/pkg-src/prerm delete mode 100755 deployment/old/debian-package-x64/pkg-src/rules delete mode 100644 deployment/old/debian-package-x64/pkg-src/source.lintian-overrides delete mode 100644 deployment/old/debian-package-x64/pkg-src/source/format delete mode 100644 deployment/old/debian-package-x64/pkg-src/source/options delete mode 100644 deployment/old/fedora-package-x64/Dockerfile delete mode 100755 deployment/old/fedora-package-x64/clean.sh delete mode 100644 deployment/old/fedora-package-x64/dependencies.txt delete mode 100755 deployment/old/fedora-package-x64/docker-build.sh delete mode 100755 deployment/old/fedora-package-x64/package.sh delete mode 100644 deployment/old/fedora-package-x64/pkg-src/.gitignore delete mode 100644 deployment/old/fedora-package-x64/pkg-src/README.md delete mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin-firewalld.xml delete mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin.env delete mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin.override.conf delete mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin.service delete mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin.spec delete mode 100644 deployment/old/fedora-package-x64/pkg-src/jellyfin.sudoers delete mode 100755 deployment/old/fedora-package-x64/pkg-src/restart.sh delete mode 100644 deployment/old/linux-x64/Dockerfile delete mode 100755 deployment/old/linux-x64/clean.sh delete mode 100644 deployment/old/linux-x64/dependencies.txt delete mode 100755 deployment/old/linux-x64/docker-build.sh delete mode 100755 deployment/old/linux-x64/package.sh delete mode 100644 deployment/old/macos/Dockerfile delete mode 100755 deployment/old/macos/clean.sh delete mode 100644 deployment/old/macos/dependencies.txt delete mode 100755 deployment/old/macos/docker-build.sh delete mode 100755 deployment/old/macos/package.sh delete mode 100644 deployment/old/portable/Dockerfile delete mode 100755 deployment/old/portable/clean.sh delete mode 100644 deployment/old/portable/dependencies.txt delete mode 100755 deployment/old/portable/docker-build.sh delete mode 100755 deployment/old/portable/package.sh delete mode 100644 deployment/old/ubuntu-package-arm64/Dockerfile.amd64 delete mode 100644 deployment/old/ubuntu-package-arm64/Dockerfile.arm64 delete mode 100755 deployment/old/ubuntu-package-arm64/clean.sh delete mode 100644 deployment/old/ubuntu-package-arm64/dependencies.txt delete mode 100755 deployment/old/ubuntu-package-arm64/docker-build.sh delete mode 100755 deployment/old/ubuntu-package-arm64/package.sh delete mode 120000 deployment/old/ubuntu-package-arm64/pkg-src delete mode 100644 deployment/old/ubuntu-package-armhf/Dockerfile.amd64 delete mode 100644 deployment/old/ubuntu-package-armhf/Dockerfile.armhf delete mode 100755 deployment/old/ubuntu-package-armhf/clean.sh delete mode 100644 deployment/old/ubuntu-package-armhf/dependencies.txt delete mode 100755 deployment/old/ubuntu-package-armhf/docker-build.sh delete mode 100755 deployment/old/ubuntu-package-armhf/package.sh delete mode 120000 deployment/old/ubuntu-package-armhf/pkg-src delete mode 100644 deployment/old/ubuntu-package-x64/Dockerfile delete mode 100755 deployment/old/ubuntu-package-x64/clean.sh delete mode 100644 deployment/old/ubuntu-package-x64/dependencies.txt delete mode 100755 deployment/old/ubuntu-package-x64/docker-build.sh delete mode 100755 deployment/old/ubuntu-package-x64/package.sh delete mode 120000 deployment/old/ubuntu-package-x64/pkg-src delete mode 100644 deployment/old/unraid/docker-templates/README.md delete mode 100644 deployment/old/unraid/docker-templates/jellyfin.xml delete mode 100644 deployment/old/win-x64/Dockerfile delete mode 100755 deployment/old/win-x64/clean.sh delete mode 100644 deployment/old/win-x64/dependencies.txt delete mode 100755 deployment/old/win-x64/docker-build.sh delete mode 100755 deployment/old/win-x64/package.sh delete mode 100644 deployment/old/win-x86/Dockerfile delete mode 100755 deployment/old/win-x86/clean.sh delete mode 100644 deployment/old/win-x86/dependencies.txt delete mode 100755 deployment/old/win-x86/docker-build.sh delete mode 100755 deployment/old/win-x86/package.sh diff --git a/deployment/old/README.md b/deployment/old/README.md deleted file mode 100644 index a805f59ca3..0000000000 --- a/deployment/old/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# Jellyfin Packaging - -This directory contains the packaging configuration of Jellyfin for multiple platforms. The specification is below; all package platforms must follow the specification to be compatable with the central `build` script. - -## Package List - -### Operating System Packages - -* `debian-package-x64`: Package for Debian and Ubuntu amd64 systems. -* `fedora-package-x64`: Package for Fedora, CentOS, and Red Hat Enterprise Linux amd64 systems. - -### Portable Builds (archives) - -* `linux-x64`: Portable binary archive for generic Linux amd64 systems. -* `macos`: Portable binary archive for MacOS amd64 systems. -* `win-x64`: Portable binary archive for Windows amd64 systems. -* `win-x86`: Portable binary archive for Windows i386 systems. - -### Other Builds - -These builds are not necessarily run from the `build` script, but are present for other platforms. - -* `portable`: Compiled `.dll` for use with .NET Core runtime on any system. -* `docker`: Docker manifests for auto-publishing. -* `unraid`: unRaid Docker template; not built by `build` but imported into unRaid directly. -* `windows`: Support files and scripts for Windows CI build. - -## Package Specification - -### Dependencies - -* If a platform requires additional build dependencies, the required binary names, i.e. to validate `which `, should be specified in a `dependencies.txt` file inside the platform directory. - -* Each dependency should be present on its own line. - -### Action Scripts - -* Actions are defined in BASH scripts with the name `.sh` within the platform directory. - -* The list of valid actions are: - - 1. `build`: Builds a set of binaries. - 2. `package`: Assembles the compiled binaries into a package. - 3. `sign`: Performs signing actions on a package. - 4. `publish`: Performs a publishing action for a package. - 5. `clean`: Cleans up any artifacts from the previous actions. - -* All package actions are optional, however at least one should generate output files, and any that do should contain a `clean` action. - -* Actions are executed in the order specified above, and later actions may depend on former actions. - -* Actions except for `clean` should `set -o errexit` to terminate on failed actions. - -* The `clean` action should always `exit 0` even if no work is done or it fails. - -* The `clean` action can be passed a variable as argument 1, named `keep_artifacts`, containing either the value `y` or `n`. It is indended to handle situations when the user runs `build --keep-artifacts` and should be handled intelligently. Usually, this is used to preserve Docker images while still removing temporary directories. - -### Output Files - -* Upon completion of the defined actions, at least one output file must be created in the `/pkg-dist` directory. - -* Output files will be moved to the directory `jellyfin-build/` one directory above the repository root upon completion. diff --git a/deployment/old/centos-package-x64/Dockerfile b/deployment/old/centos-package-x64/Dockerfile deleted file mode 100644 index 08219a2e4a..0000000000 --- a/deployment/old/centos-package-x64/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM centos:7 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/centos-package-x64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist - -# Prepare CentOS environment -RUN yum update -y \ - && yum install -y epel-release - -# Install build dependencies -RUN yum install -y @buildsys-build rpmdevtools yum-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel git - -# Install recent NodeJS and Yarn -RUN curl -fSsLo /etc/yum.repos.d/yarn.repo https://dl.yarnpkg.com/rpm/yarn.repo \ - && rpm -i https://rpm.nodesource.com/pub_10.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm \ - && yum install -y yarn - -# Install DotNET SDK -RUN rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm \ - && rpmdev-setuptree \ - && yum install -y dotnet-sdk-${SDK_VERSION} - -# Create symlinks and directories -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh \ - && mkdir -p ${SOURCE_DIR}/SPECS \ - && ln -s ${PLATFORM_DIR}/pkg-src/jellyfin.spec ${SOURCE_DIR}/SPECS/jellyfin.spec \ - && mkdir -p ${SOURCE_DIR}/SOURCES \ - && ln -s ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/SOURCES - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/centos-package-x64/clean.sh b/deployment/old/centos-package-x64/clean.sh deleted file mode 100755 index 31455de0d4..0000000000 --- a/deployment/old/centos-package-x64/clean.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" -VERSION="$( grep -A1 '^Version:' ${WORKDIR}/pkg-src/jellyfin.spec | awk '{ print $NF }' )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -package_source_dir="${WORKDIR}/pkg-src" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-centos-build" - -rm -f "${package_source_dir}/jellyfin-${VERSION}.tar.gz" &>/dev/null \ - || sudo rm -f "${package_source_dir}/jellyfin-${VERSION}.tar.gz" &>/dev/null - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/centos-package-x64/dependencies.txt b/deployment/old/centos-package-x64/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/centos-package-x64/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/centos-package-x64/docker-build.sh b/deployment/old/centos-package-x64/docker-build.sh deleted file mode 100755 index 62dd144e50..0000000000 --- a/deployment/old/centos-package-x64/docker-build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# Builds the RPM inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Build RPM -make -f .copr/Makefile srpm outdir=/root/rpmbuild/SRPMS -rpmbuild --rebuild -bb /root/rpmbuild/SRPMS/jellyfin-*.src.rpm - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/rpm -mv /root/rpmbuild/RPMS/x86_64/jellyfin-*.rpm /root/rpmbuild/SRPMS/jellyfin-*.src.rpm ${ARTIFACT_DIR}/rpm/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/centos-package-x64/package.sh b/deployment/old/centos-package-x64/package.sh deleted file mode 100755 index 1b983f49d9..0000000000 --- a/deployment/old/centos-package-x64/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-centos-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the RPMs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the RPMs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/rpm/* "${output_dir}" diff --git a/deployment/old/centos-package-x64/pkg-src b/deployment/old/centos-package-x64/pkg-src deleted file mode 120000 index 3ff4d3cbf5..0000000000 --- a/deployment/old/centos-package-x64/pkg-src +++ /dev/null @@ -1 +0,0 @@ -../fedora-package-x64/pkg-src/ \ No newline at end of file diff --git a/deployment/old/debian-package-arm64/Dockerfile.amd64 b/deployment/old/debian-package-arm64/Dockerfile.amd64 deleted file mode 100644 index b63e08b7dd..0000000000 --- a/deployment/old/debian-package-arm64/Dockerfile.amd64 +++ /dev/null @@ -1,43 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-arm64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Prepare the cross-toolchain -RUN dpkg --add-architecture arm64 \ - && apt-get update \ - && apt-get install -y cross-gcc-dev \ - && TARGET_LIST="arm64" cross-gcc-gensource 8 \ - && cd cross-gcc-packages-amd64/cross-gcc-8-arm64 \ - && apt-get install -y gcc-8-source libstdc++-8-dev-arm64-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:arm64 linux-libc-dev:arm64 libgcc1:arm64 libcurl4-openssl-dev:arm64 libfontconfig1-dev:arm64 libfreetype6-dev:arm64 libssl-dev:arm64 liblttng-ust0:arm64 libstdc++-8-dev:arm64 - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] -#ENTRYPOINT ["/bin/bash"] diff --git a/deployment/old/debian-package-arm64/Dockerfile.arm64 b/deployment/old/debian-package-arm64/Dockerfile.arm64 deleted file mode 100644 index 9ca4868441..0000000000 --- a/deployment/old/debian-package-arm64/Dockerfile.arm64 +++ /dev/null @@ -1,34 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-arm64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=arm64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev liblttng-ust0 - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/5a4c8f96-1c73-401c-a6de-8e100403188a/0ce6ab39747e2508366d498f9c0a0669/dotnet-sdk-3.1.100-linux-arm64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/debian-package-arm64/clean.sh b/deployment/old/debian-package-arm64/clean.sh deleted file mode 100755 index e7bfdf8b4b..0000000000 --- a/deployment/old/debian-package-arm64/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-debian_arm64-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/debian-package-arm64/dependencies.txt b/deployment/old/debian-package-arm64/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/debian-package-arm64/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/debian-package-arm64/docker-build.sh b/deployment/old/debian-package-arm64/docker-build.sh deleted file mode 100755 index 67ab6bd74b..0000000000 --- a/deployment/old/debian-package-arm64/docker-build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Builds the DEB inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image -sed -i '/dotnet-sdk-3.1,/d' debian/control - -# Build DEB -export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} -dpkg-buildpackage -us -uc -aarm64 - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/deb -mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/debian-package-arm64/package.sh b/deployment/old/debian-package-arm64/package.sh deleted file mode 100755 index 2091982187..0000000000 --- a/deployment/old/debian-package-arm64/package.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -ARCH="$( arch )" -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-debian_arm64-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Determine which Dockerfile to use -case $ARCH in - 'x86_64') - DOCKERFILE="Dockerfile.amd64" - ;; - 'armv7l') - DOCKERFILE="Dockerfile.arm64" - ;; -esac - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./${DOCKERFILE} -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/debian-package-arm64/pkg-src b/deployment/old/debian-package-arm64/pkg-src deleted file mode 120000 index 4c695fea17..0000000000 --- a/deployment/old/debian-package-arm64/pkg-src +++ /dev/null @@ -1 +0,0 @@ -../debian-package-x64/pkg-src \ No newline at end of file diff --git a/deployment/old/debian-package-armhf/Dockerfile.amd64 b/deployment/old/debian-package-armhf/Dockerfile.amd64 deleted file mode 100644 index 1b64b53148..0000000000 --- a/deployment/old/debian-package-armhf/Dockerfile.amd64 +++ /dev/null @@ -1,42 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-armhf -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Prepare the cross-toolchain -RUN dpkg --add-architecture armhf \ - && apt-get update \ - && apt-get install -y cross-gcc-dev \ - && TARGET_LIST="armhf" cross-gcc-gensource 8 \ - && cd cross-gcc-packages-amd64/cross-gcc-8-armhf \ - && apt-get install -y gcc-8-source libstdc++-8-dev-armhf-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip binutils-arm-linux-gnueabihf libc6-dev:armhf linux-libc-dev:armhf libgcc1:armhf libcurl4-openssl-dev:armhf libfontconfig1-dev:armhf libfreetype6-dev:armhf libssl-dev:armhf liblttng-ust0:armhf libstdc++-8-dev:armhf - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/debian-package-armhf/Dockerfile.armhf b/deployment/old/debian-package-armhf/Dockerfile.armhf deleted file mode 100644 index dd398b5aa5..0000000000 --- a/deployment/old/debian-package-armhf/Dockerfile.armhf +++ /dev/null @@ -1,34 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-armhf -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=armhf - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev liblttng-ust0 - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/67766a96-eb8c-4cd2-bca4-ea63d2cc115c/7bf13840aa2ed88793b7315d5e0d74e6/dotnet-sdk-3.1.100-linux-arm.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/debian-package-armhf/clean.sh b/deployment/old/debian-package-armhf/clean.sh deleted file mode 100755 index 35a3d3e9ad..0000000000 --- a/deployment/old/debian-package-armhf/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-debian_armhf-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/debian-package-armhf/dependencies.txt b/deployment/old/debian-package-armhf/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/debian-package-armhf/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/debian-package-armhf/docker-build.sh b/deployment/old/debian-package-armhf/docker-build.sh deleted file mode 100755 index 1bd7fb2911..0000000000 --- a/deployment/old/debian-package-armhf/docker-build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Builds the DEB inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image -sed -i '/dotnet-sdk-3.1,/d' debian/control - -# Build DEB -export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} -dpkg-buildpackage -us -uc -aarmhf - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/deb -mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/debian-package-armhf/package.sh b/deployment/old/debian-package-armhf/package.sh deleted file mode 100755 index 4a27dd8283..0000000000 --- a/deployment/old/debian-package-armhf/package.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -ARCH="$( arch )" -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-debian_armhf-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Determine which Dockerfile to use -case $ARCH in - 'x86_64') - DOCKERFILE="Dockerfile.amd64" - ;; - 'armv7l') - DOCKERFILE="Dockerfile.armhf" - ;; -esac - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./${DOCKERFILE} -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/debian-package-armhf/pkg-src b/deployment/old/debian-package-armhf/pkg-src deleted file mode 120000 index 0bb6d55249..0000000000 --- a/deployment/old/debian-package-armhf/pkg-src +++ /dev/null @@ -1 +0,0 @@ -../debian-package-x64/pkg-src/ \ No newline at end of file diff --git a/deployment/old/debian-package-x64/Dockerfile b/deployment/old/debian-package-x64/Dockerfile deleted file mode 100644 index e863d1edf9..0000000000 --- a/deployment/old/debian-package-x64/Dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/debian-package-x64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget npm devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/debian-package-x64/clean.sh b/deployment/old/debian-package-x64/clean.sh deleted file mode 100755 index 4e507bcb27..0000000000 --- a/deployment/old/debian-package-x64/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-debian-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/debian-package-x64/dependencies.txt b/deployment/old/debian-package-x64/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/debian-package-x64/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/debian-package-x64/docker-build.sh b/deployment/old/debian-package-x64/docker-build.sh deleted file mode 100755 index 962a522ebc..0000000000 --- a/deployment/old/debian-package-x64/docker-build.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# Builds the DEB inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image -sed -i '/dotnet-sdk-3.1,/d' debian/control - -# Build DEB -dpkg-buildpackage -us -uc - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/deb -mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/debian-package-x64/package.sh b/deployment/old/debian-package-x64/package.sh deleted file mode 100755 index 5a416959ab..0000000000 --- a/deployment/old/debian-package-x64/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-debian-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/debian-package-x64/pkg-src/changelog b/deployment/old/debian-package-x64/pkg-src/changelog deleted file mode 100644 index 51c4822370..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/changelog +++ /dev/null @@ -1,59 +0,0 @@ -jellyfin (10.5.0-1) unstable; urgency=medium - - * New upstream version 10.5.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.5.0 - - -- Jellyfin Packaging Team Fri, 11 Oct 2019 20:12:38 -0400 - -jellyfin (10.4.0-1) unstable; urgency=medium - - * New upstream version 10.4.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.4.0 - - -- Jellyfin Packaging Team Sat, 31 Aug 2019 21:38:56 -0400 - -jellyfin (10.3.7-1) unstable; urgency=medium - - * New upstream version 10.3.7; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.7 - - -- Jellyfin Packaging Team Wed, 24 Jul 2019 10:48:28 -0400 - -jellyfin (10.3.6-1) unstable; urgency=medium - - * New upstream version 10.3.6; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.6 - - -- Jellyfin Packaging Team Sat, 06 Jul 2019 13:34:19 -0400 - -jellyfin (10.3.5-1) unstable; urgency=medium - - * New upstream version 10.3.5; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.5 - - -- Jellyfin Packaging Team Sun, 09 Jun 2019 21:47:35 -0400 - -jellyfin (10.3.4-1) unstable; urgency=medium - - * New upstream version 10.3.4; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.4 - - -- Jellyfin Packaging Team Thu, 06 Jun 2019 22:45:31 -0400 - -jellyfin (10.3.3-1) unstable; urgency=medium - - * New upstream version 10.3.3; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.3 - - -- Jellyfin Packaging Team Fri, 17 May 2019 23:12:08 -0400 - -jellyfin (10.3.2-1) unstable; urgency=medium - - * New upstream version 10.3.2; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.2 - - -- Jellyfin Packaging Team Tue, 30 Apr 2019 20:18:44 -0400 - -jellyfin (10.3.1-1) unstable; urgency=medium - - * New upstream version 10.3.1; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.1 - - -- Jellyfin Packaging Team Sat, 20 Apr 2019 14:24:07 -0400 - -jellyfin (10.3.0-1) unstable; urgency=medium - - * New upstream version 10.3.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.0 - - -- Jellyfin Packaging Team Fri, 19 Apr 2019 14:24:29 -0400 diff --git a/deployment/old/debian-package-x64/pkg-src/compat b/deployment/old/debian-package-x64/pkg-src/compat deleted file mode 100644 index 45a4fb75db..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/compat +++ /dev/null @@ -1 +0,0 @@ -8 diff --git a/deployment/old/debian-package-x64/pkg-src/conf/jellyfin b/deployment/old/debian-package-x64/pkg-src/conf/jellyfin deleted file mode 100644 index c6e595f15a..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/conf/jellyfin +++ /dev/null @@ -1,40 +0,0 @@ -# Jellyfin default configuration options -# This is a POSIX shell fragment - -# Use this file to override the default configurations; add additional -# options with JELLYFIN_ADD_OPTS. - -# Under systemd, use -# /etc/systemd/system/jellyfin.service.d/jellyfin.service.conf -# to override the user or this config file's location. - -# -# General options -# - -# Program directories -JELLYFIN_DATA_DIR="/var/lib/jellyfin" -JELLYFIN_CONFIG_DIR="/etc/jellyfin" -JELLYFIN_LOG_DIR="/var/log/jellyfin" -JELLYFIN_CACHE_DIR="/var/cache/jellyfin" - -# Restart script for in-app server control -JELLYFIN_RESTART_OPT="--restartpath=/usr/lib/jellyfin/restart.sh" - -# ffmpeg binary paths, overriding the system values -JELLYFIN_FFMPEG_OPT="--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg" - -# [OPTIONAL] run Jellyfin as a headless service -#JELLYFIN_SERVICE_OPT="--service" - -# [OPTIONAL] run Jellyfin without the web app -#JELLYFIN_NOWEBAPP_OPT="--noautorunwebapp" - -# -# SysV init/Upstart options -# - -# Application username -JELLYFIN_USER="jellyfin" -# Full application command -JELLYFIN_ARGS="$JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLFIN_NOWEBAPP_OPT" diff --git a/deployment/old/debian-package-x64/pkg-src/conf/jellyfin-sudoers b/deployment/old/debian-package-x64/pkg-src/conf/jellyfin-sudoers deleted file mode 100644 index b481ba4ad4..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/conf/jellyfin-sudoers +++ /dev/null @@ -1,37 +0,0 @@ -#Allow jellyfin group to start, stop and restart itself -Cmnd_Alias RESTARTSERVER_SYSV = /sbin/service jellyfin restart, /usr/sbin/service jellyfin restart -Cmnd_Alias STARTSERVER_SYSV = /sbin/service jellyfin start, /usr/sbin/service jellyfin start -Cmnd_Alias STOPSERVER_SYSV = /sbin/service jellyfin stop, /usr/sbin/service jellyfin stop -Cmnd_Alias RESTARTSERVER_SYSTEMD = /usr/bin/systemctl restart jellyfin, /bin/systemctl restart jellyfin -Cmnd_Alias STARTSERVER_SYSTEMD = /usr/bin/systemctl start jellyfin, /bin/systemctl start jellyfin -Cmnd_Alias STOPSERVER_SYSTEMD = /usr/bin/systemctl stop jellyfin, /bin/systemctl stop jellyfin -Cmnd_Alias RESTARTSERVER_INITD = /etc/init.d/jellyfin restart -Cmnd_Alias STARTSERVER_INITD = /etc/init.d/jellyfin start -Cmnd_Alias STOPSERVER_INITD = /etc/init.d/jellyfin stop - - -jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSV -jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSV -jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSV -jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSTEMD -jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSTEMD -jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSTEMD -jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_INITD -jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_INITD -jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_INITD - -Defaults!RESTARTSERVER_SYSV !requiretty -Defaults!STARTSERVER_SYSV !requiretty -Defaults!STOPSERVER_SYSV !requiretty -Defaults!RESTARTSERVER_SYSTEMD !requiretty -Defaults!STARTSERVER_SYSTEMD !requiretty -Defaults!STOPSERVER_SYSTEMD !requiretty -Defaults!RESTARTSERVER_INITD !requiretty -Defaults!STARTSERVER_INITD !requiretty -Defaults!STOPSERVER_INITD !requiretty - -#Allow the server to mount iso images -jellyfin ALL=(ALL) NOPASSWD: /bin/mount -jellyfin ALL=(ALL) NOPASSWD: /bin/umount - -Defaults:jellyfin !requiretty diff --git a/deployment/old/debian-package-x64/pkg-src/conf/jellyfin.service.conf b/deployment/old/debian-package-x64/pkg-src/conf/jellyfin.service.conf deleted file mode 100644 index 1b69dd74ef..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/conf/jellyfin.service.conf +++ /dev/null @@ -1,7 +0,0 @@ -# Jellyfin systemd configuration options - -# Use this file to override the user or environment file location. - -[Service] -#User = jellyfin -#EnvironmentFile = /etc/default/jellyfin diff --git a/deployment/old/debian-package-x64/pkg-src/conf/logging.json b/deployment/old/debian-package-x64/pkg-src/conf/logging.json deleted file mode 100644 index f32b2089eb..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/conf/logging.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "Serilog": { - "MinimumLevel": "Information", - "WriteTo": [ - { - "Name": "Console", - "Args": { - "outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}" - } - }, - { - "Name": "Async", - "Args": { - "configure": [ - { - "Name": "File", - "Args": { - "path": "%JELLYFIN_LOG_DIR%//jellyfin.log", - "fileSizeLimitBytes": 10485700, - "rollOnFileSizeLimit": true, - "retainedFileCountLimit": 10, - "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}" - } - } - ] - } - } - ] - } -} diff --git a/deployment/old/debian-package-x64/pkg-src/control b/deployment/old/debian-package-x64/pkg-src/control deleted file mode 100644 index 13fd3ecabb..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/control +++ /dev/null @@ -1,31 +0,0 @@ -Source: jellyfin -Section: misc -Priority: optional -Maintainer: Jellyfin Team -Build-Depends: debhelper (>= 9), - dotnet-sdk-3.1, - libc6-dev, - libcurl4-openssl-dev, - libfontconfig1-dev, - libfreetype6-dev, - libssl-dev, - wget, - npm | nodejs -Standards-Version: 3.9.4 -Homepage: https://jellyfin.media/ -Vcs-Git: https://github.org/jellyfin/jellyfin.git -Vcs-Browser: https://github.org/jellyfin/jellyfin - -Package: jellyfin -Replaces: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server -Breaks: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server -Conflicts: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server -Architecture: any -Depends: at, - libsqlite3-0, - jellyfin-ffmpeg, - libfontconfig1, - libfreetype6, - libssl1.1 -Description: Jellyfin is a home media server. - It is built on top of other popular open source technologies such as Service Stack, jQuery, jQuery mobile, and Mono. It features a REST-based api with built-in documentation to facilitate client development. We also have client libraries for our api to enable rapid development. diff --git a/deployment/old/debian-package-x64/pkg-src/copyright b/deployment/old/debian-package-x64/pkg-src/copyright deleted file mode 100644 index 0d7a2a6007..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/copyright +++ /dev/null @@ -1,29 +0,0 @@ -Format: http://dep.debian.net/deps/dep5 -Upstream-Name: jellyfin -Source: https://github.com/jellyfin/jellyfin - -Files: * -Copyright: 2018 Jellyfin Team -License: GPL-2.0+ - -Files: debian/* -Copyright: 2018 Joshua Boniface -Copyright: 2014 Carlos Hernandez -License: GPL-2.0+ - -License: GPL-2.0+ - This package is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - . - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see - . - On Debian systems, the complete text of the GNU General - Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/deployment/old/debian-package-x64/pkg-src/gbp.conf b/deployment/old/debian-package-x64/pkg-src/gbp.conf deleted file mode 100644 index 60b3d28723..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/gbp.conf +++ /dev/null @@ -1,6 +0,0 @@ -[DEFAULT] -pristine-tar = False -cleaner = fakeroot debian/rules clean - -[import-orig] -filter = [ ".git*", ".hg*", ".vs*", ".vscode*" ] diff --git a/deployment/old/debian-package-x64/pkg-src/install b/deployment/old/debian-package-x64/pkg-src/install deleted file mode 100644 index 994322d141..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/install +++ /dev/null @@ -1,6 +0,0 @@ -usr/lib/jellyfin usr/lib/ -debian/conf/jellyfin etc/default/ -debian/conf/logging.json etc/jellyfin/ -debian/conf/jellyfin.service.conf etc/systemd/system/jellyfin.service.d/ -debian/conf/jellyfin-sudoers etc/sudoers.d/ -debian/bin/restart.sh usr/lib/jellyfin/ diff --git a/deployment/old/debian-package-x64/pkg-src/jellyfin.init b/deployment/old/debian-package-x64/pkg-src/jellyfin.init deleted file mode 100644 index 7f5642bac1..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/jellyfin.init +++ /dev/null @@ -1,61 +0,0 @@ -### BEGIN INIT INFO -# Provides: Jellyfin Media Server -# Required-Start: $local_fs $network -# Required-Stop: $local_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Jellyfin Media Server -# Description: Runs Jellyfin Server -### END INIT INFO - -set -e - -# Carry out specific functions when asked to by the system - -if test -f /etc/default/jellyfin; then - . /etc/default/jellyfin -fi - -. /lib/lsb/init-functions - -PIDFILE="/run/jellyfin.pid" - -case "$1" in - start) - log_daemon_msg "Starting Jellyfin Media Server" "jellyfin" || true - - if start-stop-daemon --start --quiet --oknodo --background --pidfile $PIDFILE --make-pidfile --user $JELLYFIN_USER --chuid $JELLYFIN_USER --exec /usr/bin/jellyfin -- $JELLYFIN_ARGS; then - log_end_msg 0 || true - else - log_end_msg 1 || true - fi - ;; - - stop) - log_daemon_msg "Stopping Jellyfin Media Server" "jellyfin" || true - if start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --remove-pidfile; then - log_end_msg 0 || true - else - log_end_msg 1 || true - fi - ;; - - restart) - log_daemon_msg "Restarting Jellyfin Media Server" "jellyfin" || true - start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PIDFILE --remove-pidfile - if start-stop-daemon --start --quiet --oknodo --background --pidfile $PIDFILE --make-pidfile --user $JELLYFIN_USER --chuid $JELLYFIN_USER --exec /usr/bin/jellyfin -- $JELLYFIN_ARGS; then - log_end_msg 0 || true - else - log_end_msg 1 || true - fi - ;; - - status) - status_of_proc -p $PIDFILE /usr/bin/jellyfin jellyfin && exit 0 || exit $? - ;; - - *) - echo "Usage: $0 {start|stop|restart|status}" - exit 1 - ;; -esac diff --git a/deployment/old/debian-package-x64/pkg-src/jellyfin.service b/deployment/old/debian-package-x64/pkg-src/jellyfin.service deleted file mode 100644 index 1305e238b0..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/jellyfin.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description = Jellyfin Media Server -After = network.target - -[Service] -Type = simple -EnvironmentFile = /etc/default/jellyfin -User = jellyfin -ExecStart = /usr/bin/jellyfin ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT} -Restart = on-failure -TimeoutSec = 15 - -[Install] -WantedBy = multi-user.target diff --git a/deployment/old/debian-package-x64/pkg-src/jellyfin.upstart b/deployment/old/debian-package-x64/pkg-src/jellyfin.upstart deleted file mode 100644 index ef5bc9bcaf..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/jellyfin.upstart +++ /dev/null @@ -1,20 +0,0 @@ -description "jellyfin daemon" - -start on (local-filesystems and net-device-up IFACE!=lo) -stop on runlevel [!2345] - -console log -respawn -respawn limit 10 5 - -kill timeout 20 - -script - set -x - echo "Starting $UPSTART_JOB" - - # Log file - logger -t "$0" "DEBUG: `set`" - . /etc/default/jellyfin - exec su -u $JELLYFIN_USER -c /usr/bin/jellyfin $JELLYFIN_ARGS -end script diff --git a/deployment/old/debian-package-x64/pkg-src/po/POTFILES.in b/deployment/old/debian-package-x64/pkg-src/po/POTFILES.in deleted file mode 100644 index cef83a3407..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/po/POTFILES.in +++ /dev/null @@ -1 +0,0 @@ -[type: gettext/rfc822deb] templates diff --git a/deployment/old/debian-package-x64/pkg-src/po/templates.pot b/deployment/old/debian-package-x64/pkg-src/po/templates.pot deleted file mode 100644 index 2cdcae4173..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/po/templates.pot +++ /dev/null @@ -1,57 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: jellyfin-server\n" -"Report-Msgid-Bugs-To: jellyfin-server@packages.debian.org\n" -"POT-Creation-Date: 2015-06-12 20:51-0600\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Type: note -#. Description -#: ../templates:1001 -msgid "Jellyfin permission info:" -msgstr "" - -#. Type: note -#. Description -#: ../templates:1001 -msgid "" -"Jellyfin by default runs under a user named \"jellyfin\". Please ensure that the " -"user jellyfin has read and write access to any folders you wish to add to your " -"library. Otherwise please run jellyfin under a different user." -msgstr "" - -#. Type: string -#. Description -#: ../templates:2001 -msgid "Username to run Jellyfin as:" -msgstr "" - -#. Type: string -#. Description -#: ../templates:2001 -msgid "The user that jellyfin will run as." -msgstr "" - -#. Type: note -#. Description -#: ../templates:3001 -msgid "Jellyfin still running" -msgstr "" - -#. Type: note -#. Description -#: ../templates:3001 -msgid "Jellyfin is currently running. Please close it and try again." -msgstr "" diff --git a/deployment/old/debian-package-x64/pkg-src/postinst b/deployment/old/debian-package-x64/pkg-src/postinst deleted file mode 100644 index 860222e051..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/postinst +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash -set -e - -NAME=jellyfin -DEFAULT_FILE=/etc/default/${NAME} - -# Source Jellyfin default configuration -if [[ -f $DEFAULT_FILE ]]; then - . $DEFAULT_FILE -fi - -# Data directories for program data (cache, db), configs, and logs -PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} -CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} -LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} -CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} - -case "$1" in - configure) - # create jellyfin group if it does not exist - if [[ -z "$(getent group jellyfin)" ]]; then - addgroup --quiet --system jellyfin > /dev/null 2>&1 - fi - # create jellyfin user if it does not exist - if [[ -z "$(getent passwd jellyfin)" ]]; then - adduser --system --ingroup jellyfin --shell /bin/false jellyfin --no-create-home --home ${PROGRAMDATA} \ - --gecos "Jellyfin default user" > /dev/null 2>&1 - fi - # ensure $PROGRAMDATA exists - if [[ ! -d $PROGRAMDATA ]]; then - mkdir $PROGRAMDATA - fi - # ensure $CONFIGDATA exists - if [[ ! -d $CONFIGDATA ]]; then - mkdir $CONFIGDATA - fi - # ensure $LOGDATA exists - if [[ ! -d $LOGDATA ]]; then - mkdir $LOGDATA - fi - # ensure $CACHEDATA exists - if [[ ! -d $CACHEDATA ]]; then - mkdir $CACHEDATA - fi - # Ensure permissions are correct on all config directories - chown -R jellyfin $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA - chgrp adm $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA - chmod 0750 $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA - - chmod +x /usr/lib/jellyfin/restart.sh > /dev/null 2>&1 || true - - # Install jellyfin symlink into /usr/bin - ln -sf /usr/lib/jellyfin/bin/jellyfin /usr/bin/jellyfin - - ;; - abort-upgrade|abort-remove|abort-deconfigure) - ;; - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER - -if [[ -x "/usr/bin/deb-systemd-helper" ]]; then - # Manual init script handling - deb-systemd-helper unmask jellyfin.service >/dev/null || true - # was-enabled defaults to true, so new installations run enable. - if deb-systemd-helper --quiet was-enabled jellyfin.service; then - # Enables the unit on first installation, creates new - # symlinks on upgrades if the unit file has changed. - deb-systemd-helper enable jellyfin.service >/dev/null || true - else - # Update the statefile to add new symlinks (if any), which need to be - # cleaned up on purge. Also remove old symlinks. - deb-systemd-helper update-state jellyfin.service >/dev/null || true - fi -fi - -# End automatically added section -# Automatically added by dh_installinit -if [[ "$1" == "configure" ]] || [[ "$1" == "abort-upgrade" ]]; then - if [[ -d "/run/systemd/systemd" ]]; then - systemctl --system daemon-reload >/dev/null || true - deb-systemd-invoke start jellyfin >/dev/null || true - elif [[ -x "/etc/init.d/jellyfin" ]] || [[ -e "/etc/init/jellyfin.conf" ]]; then - update-rc.d jellyfin defaults >/dev/null - invoke-rc.d jellyfin start || exit $? - fi -fi -exit 0 diff --git a/deployment/old/debian-package-x64/pkg-src/postrm b/deployment/old/debian-package-x64/pkg-src/postrm deleted file mode 100644 index 1d00a984ec..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/postrm +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -set -e - -NAME=jellyfin -DEFAULT_FILE=/etc/default/${NAME} - -# Source Jellyfin default configuration -if [[ -f $DEFAULT_FILE ]]; then - . $DEFAULT_FILE -fi - -# Data directories for program data (cache, db), configs, and logs -PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} -CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} -LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} -CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} - -# In case this system is running systemd, we make systemd reload the unit files -# to pick up changes. -if [[ -d /run/systemd/system ]] ; then - systemctl --system daemon-reload >/dev/null || true -fi - -case "$1" in - purge) - echo PURGE | debconf-communicate $NAME > /dev/null 2>&1 || true - - if [[ -x "/etc/init.d/jellyfin" ]] || [[ -e "/etc/init/jellyfin.connf" ]]; then - update-rc.d jellyfin remove >/dev/null 2>&1 || true - fi - - if [[ -x "/usr/bin/deb-systemd-helper" ]]; then - deb-systemd-helper purge jellyfin.service >/dev/null - deb-systemd-helper unmask jellyfin.service >/dev/null - fi - - # Remove user and group - userdel jellyfin > /dev/null 2>&1 || true - delgroup --quiet jellyfin > /dev/null 2>&1 || true - # Remove config dir - if [[ -d $CONFIGDATA ]]; then - rm -rf $CONFIGDATA - fi - # Remove log dir - if [[ -d $LOGDATA ]]; then - rm -rf $LOGDATA - fi - # Remove cache dir - if [[ -d $CACHEDATA ]]; then - rm -rf $CACHEDATA - fi - # Remove program data dir - if [[ -d $PROGRAMDATA ]]; then - rm -rf $PROGRAMDATA - fi - # Remove binary symlink - [[ -f /usr/bin/jellyfin ]] && rm /usr/bin/jellyfin - # Remove sudoers config - [[ -f /etc/sudoers.d/jellyfin-sudoers ]] && rm /etc/sudoers.d/jellyfin-sudoers - # Remove anything at the default locations; catches situations where the user moved the defaults - [[ -e /etc/jellyfin ]] && rm -rf /etc/jellyfin - [[ -e /var/log/jellyfin ]] && rm -rf /var/log/jellyfin - [[ -e /var/cache/jellyfin ]] && rm -rf /var/cache/jellyfin - [[ -e /var/lib/jellyfin ]] && rm -rf /var/lib/jellyfin - ;; - remove) - if [[ -x "/usr/bin/deb-systemd-helper" ]]; then - deb-systemd-helper mask jellyfin.service >/dev/null - fi - ;; - upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - ;; - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/deployment/old/debian-package-x64/pkg-src/preinst b/deployment/old/debian-package-x64/pkg-src/preinst deleted file mode 100644 index 2713fb9b80..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/preinst +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash -set -e - -NAME=jellyfin -DEFAULT_FILE=/etc/default/${NAME} - -# Source Jellyfin default configuration -if [[ -f $DEFAULT_FILE ]]; then - . $DEFAULT_FILE -fi - -# Data directories for program data (cache, db), configs, and logs -PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} -CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} -LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} -CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} - -# In case this system is running systemd, we make systemd reload the unit files -# to pick up changes. -if [[ -d /run/systemd/system ]] ; then - systemctl --system daemon-reload >/dev/null || true -fi - -case "$1" in - install|upgrade) - # try graceful termination; - if [[ -d /run/systemd/system ]]; then - deb-systemd-invoke stop ${NAME}.service > /dev/null 2>&1 || true - elif [ -x "/etc/init.d/${NAME}" ] || [ -e "/etc/init/${NAME}.conf" ]; then - invoke-rc.d ${NAME} stop > /dev/null 2>&1 || true - fi - # try and figure out if jellyfin is running - PIDFILE=$(find /var/run/ -maxdepth 1 -mindepth 1 -name "jellyfin*.pid" -print -quit) - [[ -n "$PIDFILE" ]] && [[ -s "$PIDFILE" ]] && JELLYFIN_PID=$(cat ${PIDFILE}) - # if its running, let's stop it - if [[ -n "$JELLYFIN_PID" ]]; then - echo "Stopping Jellyfin!" - # if jellyfin is still running, kill it - if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then - CPIDS=$(pgrep -P $JELLYFIN_PID) - sleep 2 && kill -KILL $CPIDS - kill -TERM $CPIDS > /dev/null 2>&1 - fi - sleep 1 - # if it's still running, show error - if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then - echo "Could not successfully stop JellyfinServer, please do so before uninstalling." - exit 1 - else - [[ -f $PIDFILE ]] && rm $PIDFILE - fi - fi - - # Clean up old Emby cruft that can break the user's system - [[ -f /etc/sudoers.d/emby ]] && rm -f /etc/sudoers.d/emby - - # If we have existing config, log, or cache dirs in /var/lib/jellyfin, move them into the right place - if [[ -d $PROGRAMDATA/config ]]; then - mv $PROGRAMDATA/config $CONFIGDATA - fi - if [[ -d $PROGRAMDATA/logs ]]; then - mv $PROGRAMDATA/logs $LOGDATA - fi - if [[ -d $PROGRAMDATA/logs ]]; then - mv $PROGRAMDATA/cache $CACHEDATA - fi - - ;; - abort-upgrade) - ;; - *) - echo "preinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac -#DEBHELPER# - -exit 0 diff --git a/deployment/old/debian-package-x64/pkg-src/prerm b/deployment/old/debian-package-x64/pkg-src/prerm deleted file mode 100644 index e965cb7d71..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/prerm +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -set -e - -NAME=jellyfin -DEFAULT_FILE=/etc/default/${NAME} - -# Source Jellyfin default configuration -if [[ -f $DEFAULT_FILE ]]; then - . $DEFAULT_FILE -fi - -# Data directories for program data (cache, db), configs, and logs -PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} -CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} -LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} -CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME} - -case "$1" in - remove|upgrade|deconfigure) - echo "Stopping Jellyfin!" - # try graceful termination; - if [[ -d /run/systemd/system ]]; then - deb-systemd-invoke stop ${NAME}.service > /dev/null 2>&1 || true - elif [ -x "/etc/init.d/${NAME}" ] || [ -e "/etc/init/${NAME}.conf" ]; then - invoke-rc.d ${NAME} stop > /dev/null 2>&1 || true - fi - # Ensure that it is shutdown - PIDFILE=$(find /var/run/ -maxdepth 1 -mindepth 1 -name "jellyfin*.pid" -print -quit) - [[ -n "$PIDFILE" ]] && [[ -s "$PIDFILE" ]] && JELLYFIN_PID=$(cat ${PIDFILE}) - # if its running, let's stop it - if [[ -n "$JELLYFIN_PID" ]]; then - # if jellyfin is still running, kill it - if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then - CPIDS=$(pgrep -P $JELLYFIN_PID) - sleep 2 && kill -KILL $CPIDS - kill -TERM $CPIDS > /dev/null 2>&1 - fi - sleep 1 - # if it's still running, show error - if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then - echo "Could not successfully stop Jellyfin, please do so before uninstalling." - exit 1 - else - [[ -f $PIDFILE ]] && rm $PIDFILE - fi - fi - if [[ -f /usr/lib/jellyfin/bin/MediaBrowser.Server.Mono.exe.so ]]; then - rm /usr/lib/jellyfin/bin/MediaBrowser.Server.Mono.exe.so - fi - ;; - failed-upgrade) - ;; - *) - echo "prerm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/deployment/old/debian-package-x64/pkg-src/rules b/deployment/old/debian-package-x64/pkg-src/rules deleted file mode 100755 index c2d57dfb22..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/rules +++ /dev/null @@ -1,66 +0,0 @@ -#! /usr/bin/make -f -CONFIG := Release -TERM := xterm -SHELL := /bin/bash -WEB_TARGET := $(CURDIR)/MediaBrowser.WebDashboard/jellyfin-web -WEB_VERSION := $(shell sed -n -e 's/^version: "\(.*\)"/\1/p' $(CURDIR)/build.yaml) - -HOST_ARCH := $(shell arch) -BUILD_ARCH := ${DEB_HOST_MULTIARCH} -ifeq ($(HOST_ARCH),x86_64) - # Building AMD64 - DOTNETRUNTIME := debian-x64 - ifeq ($(BUILD_ARCH),arm-linux-gnueabihf) - # Cross-building ARM on AMD64 - DOTNETRUNTIME := debian-arm - endif - ifeq ($(BUILD_ARCH),aarch64-linux-gnu) - # Cross-building ARM on AMD64 - DOTNETRUNTIME := debian-arm64 - endif -endif -ifeq ($(HOST_ARCH),armv7l) - # Building ARM - DOTNETRUNTIME := debian-arm -endif -ifeq ($(HOST_ARCH),arm64) - # Building ARM - DOTNETRUNTIME := debian-arm64 -endif - -export DH_VERBOSE=1 -export DOTNET_CLI_TELEMETRY_OPTOUT=1 - -%: - dh $@ - -# disable "make check" -override_dh_auto_test: - -# disable stripping debugging symbols -override_dh_clistrip: - -override_dh_auto_build: - echo $(WEB_VERSION) - # Clone down and build Web frontend - mkdir -p $(WEB_TARGET) - wget -O web-src.tgz https://github.com/jellyfin/jellyfin-web/archive/v$(WEB_VERSION).tar.gz || wget -O web-src.tgz https://github.com/jellyfin/jellyfin-web/archive/master.tar.gz - mkdir -p $(CURDIR)/web - tar -xzf web-src.tgz -C $(CURDIR)/web/ --strip 1 - cd $(CURDIR)/web/ && npm install yarn - cd $(CURDIR)/web/ && node_modules/yarn/bin/yarn install - mv $(CURDIR)/web/dist/* $(WEB_TARGET)/ - # Build the application - dotnet publish --configuration $(CONFIG) --output='$(CURDIR)/usr/lib/jellyfin/bin' --self-contained --runtime $(DOTNETRUNTIME) \ - "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" Jellyfin.Server - -override_dh_auto_clean: - dotnet clean -maxcpucount:1 --configuration $(CONFIG) Jellyfin.Server || true - rm -f '$(CURDIR)/web-src.tgz' - rm -rf '$(CURDIR)/usr' - rm -rf '$(CURDIR)/web' - rm -rf '$(WEB_TARGET)' - -# Force the service name to jellyfin even if we're building jellyfin-nightly -override_dh_installinit: - dh_installinit --name=jellyfin diff --git a/deployment/old/debian-package-x64/pkg-src/source.lintian-overrides b/deployment/old/debian-package-x64/pkg-src/source.lintian-overrides deleted file mode 100644 index aeb332f13a..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/source.lintian-overrides +++ /dev/null @@ -1,3 +0,0 @@ -# This is an override for the following lintian errors: -jellyfin source: license-problem-md5sum-non-free-file Emby.Drawing/ImageMagick/fonts/webdings.ttf* -jellyfin source: source-is-missing diff --git a/deployment/old/debian-package-x64/pkg-src/source/format b/deployment/old/debian-package-x64/pkg-src/source/format deleted file mode 100644 index d3827e75a5..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/source/format +++ /dev/null @@ -1 +0,0 @@ -1.0 diff --git a/deployment/old/debian-package-x64/pkg-src/source/options b/deployment/old/debian-package-x64/pkg-src/source/options deleted file mode 100644 index 17b5373d5e..0000000000 --- a/deployment/old/debian-package-x64/pkg-src/source/options +++ /dev/null @@ -1,11 +0,0 @@ -tar-ignore='.git*' -tar-ignore='**/.git' -tar-ignore='**/.hg' -tar-ignore='**/.vs' -tar-ignore='**/.vscode' -tar-ignore='deployment' -tar-ignore='**/bin' -tar-ignore='**/obj' -tar-ignore='**/.nuget' -tar-ignore='*.deb' -tar-ignore='ThirdParty' diff --git a/deployment/old/fedora-package-x64/Dockerfile b/deployment/old/fedora-package-x64/Dockerfile deleted file mode 100644 index 87120f3a05..0000000000 --- a/deployment/old/fedora-package-x64/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM fedora:31 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/fedora-package-x64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist - -# Prepare Fedora environment -RUN dnf update -y - -# Install build dependencies -RUN dnf install -y @buildsys-build rpmdevtools git dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel nodejs-yarn - -# Install DotNET SDK -RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \ - && curl -o /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/$(rpm -E %fedora)/prod.repo \ - && dnf install -y dotnet-sdk-${SDK_VERSION} dotnet-runtime-${SDK_VERSION} - -# Create symlinks and directories -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh \ - && mkdir -p ${SOURCE_DIR}/SPECS \ - && ln -s ${PLATFORM_DIR}/pkg-src/jellyfin.spec ${SOURCE_DIR}/SPECS/jellyfin.spec \ - && mkdir -p ${SOURCE_DIR}/SOURCES \ - && ln -s ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/SOURCES - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/fedora-package-x64/clean.sh b/deployment/old/fedora-package-x64/clean.sh deleted file mode 100755 index 700c8f1bb3..0000000000 --- a/deployment/old/fedora-package-x64/clean.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" -VERSION="$( grep -A1 '^Version:' ${WORKDIR}/pkg-src/jellyfin.spec | awk '{ print $NF }' )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -package_source_dir="${WORKDIR}/pkg-src" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-fedora-build" - -rm -f "${package_source_dir}/jellyfin-${VERSION}.tar.gz" &>/dev/null \ - || sudo rm -f "${package_source_dir}/jellyfin-${VERSION}.tar.gz" &>/dev/null - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/fedora-package-x64/dependencies.txt b/deployment/old/fedora-package-x64/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/fedora-package-x64/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/fedora-package-x64/docker-build.sh b/deployment/old/fedora-package-x64/docker-build.sh deleted file mode 100755 index 740e8d35ca..0000000000 --- a/deployment/old/fedora-package-x64/docker-build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# Builds the RPM inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Build RPM -make -f .copr/Makefile srpm outdir=/root/rpmbuild/SRPMS -rpmbuild -rb /root/rpmbuild/SRPMS/jellyfin-*.src.rpm - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/rpm -mv /root/rpmbuild/RPMS/x86_64/jellyfin-*.rpm /root/rpmbuild/SRPMS/jellyfin-*.src.rpm ${ARTIFACT_DIR}/rpm/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/fedora-package-x64/package.sh b/deployment/old/fedora-package-x64/package.sh deleted file mode 100755 index ae6962dd1f..0000000000 --- a/deployment/old/fedora-package-x64/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-fedora-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the RPMs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the RPMs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/rpm/* "${output_dir}" diff --git a/deployment/old/fedora-package-x64/pkg-src/.gitignore b/deployment/old/fedora-package-x64/pkg-src/.gitignore deleted file mode 100644 index 6019b98c22..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.rpm -*.zip -*.tar.gz \ No newline at end of file diff --git a/deployment/old/fedora-package-x64/pkg-src/README.md b/deployment/old/fedora-package-x64/pkg-src/README.md deleted file mode 100644 index 7ed6f7efc6..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Jellyfin RPM - -## Build Fedora Package with docker - -Change into this directory `cd rpm-package` -Run the build script `./build-fedora-rpm.sh`. -Resulting RPM and src.rpm will be in `../../jellyfin-*.rpm` - -## ffmpeg - -The RPM package for Fedora/CentOS requires some additional repositories as ffmpeg is not in the main repositories. - -```shell -# ffmpeg from RPMfusion free -# Fedora -$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm -# CentOS 7 -$ sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm -``` - -## ISO mounting - -To allow Jellyfin to mount/umount ISO files uncomment these two lines in `/etc/sudoers.d/jellyfin-sudoers` -``` -# %jellyfin ALL=(ALL) NOPASSWD: /bin/mount -# %jellyfin ALL=(ALL) NOPASSWD: /bin/umount -``` - -## Building with dotnet - -Jellyfin is build with `--self-contained` so no dotnet required for runtime. - -```shell -# dotnet required for building the RPM -# Fedora -$ sudo dnf copr enable @dotnet-sig/dotnet -# CentOS -$ sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm -``` - -## TODO - -- [ ] OpenSUSE \ No newline at end of file diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin-firewalld.xml b/deployment/old/fedora-package-x64/pkg-src/jellyfin-firewalld.xml deleted file mode 100644 index 538c5d65f8..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/jellyfin-firewalld.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - Jellyfin - The Free Software Media System. - - - - - diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin.env b/deployment/old/fedora-package-x64/pkg-src/jellyfin.env deleted file mode 100644 index de48f13af5..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/jellyfin.env +++ /dev/null @@ -1,34 +0,0 @@ -# Jellyfin default configuration options - -# Use this file to override the default configurations; add additional -# options with JELLYFIN_ADD_OPTS. - -# To override the user or this config file's location, use -# /etc/systemd/system/jellyfin.service.d/override.conf - -# -# This is a POSIX shell fragment -# - -# -# General options -# - -# Program directories -JELLYFIN_DATA_DIR="/var/lib/jellyfin" -JELLYFIN_CONFIG_DIR="/etc/jellyfin" -JELLYFIN_LOG_DIR="/var/log/jellyfin" -JELLYFIN_CACHE_DIR="/var/cache/jellyfin" - -# In-App service control -JELLYFIN_RESTART_OPT="--restartpath=/usr/libexec/jellyfin/restart.sh" - -# [OPTIONAL] ffmpeg binary paths, overriding the UI-configured values -#JELLYFIN_FFMPEG_OPT="--ffmpeg=/usr/bin/ffmpeg" - -# [OPTIONAL] run Jellyfin as a headless service -#JELLYFIN_SERVICE_OPT="--service" - -# [OPTIONAL] run Jellyfin without the web app -#JELLYFIN_NOWEBAPP_OPT="--noautorunwebapp" - diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin.override.conf b/deployment/old/fedora-package-x64/pkg-src/jellyfin.override.conf deleted file mode 100644 index 8652450bb4..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/jellyfin.override.conf +++ /dev/null @@ -1,7 +0,0 @@ -# Jellyfin systemd configuration options - -# Use this file to override the user or environment file location. - -[Service] -#User = jellyfin -#EnvironmentFile = /etc/sysconfig/jellyfin diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin.service b/deployment/old/fedora-package-x64/pkg-src/jellyfin.service deleted file mode 100644 index f3dc594b1c..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/jellyfin.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -After=network.target -Description=Jellyfin is a free software media system that puts you in control of managing and streaming your media. - -[Service] -EnvironmentFile=/etc/sysconfig/jellyfin -WorkingDirectory=/var/lib/jellyfin -ExecStart=/usr/bin/jellyfin ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT} -TimeoutSec=15 -Restart=on-failure -User=jellyfin -Group=jellyfin - -[Install] -WantedBy=multi-user.target diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin.spec b/deployment/old/fedora-package-x64/pkg-src/jellyfin.spec deleted file mode 100644 index 33c6f6f648..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/jellyfin.spec +++ /dev/null @@ -1,181 +0,0 @@ -%global debug_package %{nil} -# Set the dotnet runtime -%if 0%{?fedora} -%global dotnet_runtime fedora-x64 -%else -%global dotnet_runtime centos-x64 -%endif - -Name: jellyfin -Version: 10.5.0 -Release: 1%{?dist} -Summary: The Free Software Media Browser -License: GPLv2 -URL: https://jellyfin.media -# Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%{version}.tar.gz` -Source0: https://github.com/%{name}/%{name}/archive/%{name}-%{version}.tar.gz -# Jellyfin Webinterface downloaded by `make -f .copr/Makefile srpm`, real URL ends with `v%{version}.tar.gz` -Source1: https://github.com/%{name}/%{name}-web/archive/%{name}-web-%{version}.tar.gz -Source11: jellyfin.service -Source12: jellyfin.env -Source13: jellyfin.sudoers -Source14: restart.sh -Source15: jellyfin.override.conf -Source16: jellyfin-firewalld.xml - -%{?systemd_requires} -BuildRequires: systemd -Requires(pre): shadow-utils -BuildRequires: libcurl-devel, fontconfig-devel, freetype-devel, openssl-devel, glibc-devel, libicu-devel, git -%if 0%{?fedora} -BuildRequires: nodejs-yarn, git -%else -# Requirements not packaged in main repos -# From https://rpm.nodesource.com/pub_10.x/el/7/x86_64/ -BuildRequires: nodejs >= 10 yarn -%endif -Requires: libcurl, fontconfig, freetype, openssl, glibc libicu -# Requirements not packaged in main repos -# COPR @dotnet-sig/dotnet or -# https://packages.microsoft.com/rhel/7/prod/ -BuildRequires: dotnet-runtime-3.1, dotnet-sdk-3.1 -# RPMfusion free -Requires: ffmpeg - -# Disable Automatic Dependency Processing -AutoReqProv: no - -%description -Jellyfin is a free software media system that puts you in control of managing and streaming your media. - - -%prep -%autosetup -n %{name}-%{version} -b 0 -b 1 -web_build_dir="$(mktemp -d)" -web_target="$PWD/MediaBrowser.WebDashboard/jellyfin-web" -pushd ../jellyfin-web-%{version} || pushd ../jellyfin-web-master -%if 0%{?fedora} -nodejs-yarn install -%else -yarn install -%endif -mkdir -p ${web_target} -mv dist/* ${web_target}/ -popd - -%build - -%install -export DOTNET_CLI_TELEMETRY_OPTOUT=1 -export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime %{dotnet_runtime} \ - "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" Jellyfin.Server -%{__install} -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/%{name}/LICENSE -%{__install} -D -m 0644 %{SOURCE15} %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/override.conf -%{__install} -D -m 0644 Jellyfin.Server/Resources/Configuration/logging.json %{buildroot}%{_sysconfdir}/%{name}/logging.json -%{__mkdir} -p %{buildroot}%{_bindir} -tee %{buildroot}%{_bindir}/jellyfin << EOF -#!/bin/sh -exec %{_libdir}/%{name}/%{name} \${@} -EOF -%{__mkdir} -p %{buildroot}%{_sharedstatedir}/jellyfin -%{__mkdir} -p %{buildroot}%{_sysconfdir}/%{name} -%{__mkdir} -p %{buildroot}%{_var}/log/jellyfin -%{__mkdir} -p %{buildroot}%{_var}/cache/jellyfin - -%{__install} -D -m 0644 %{SOURCE11} %{buildroot}%{_unitdir}/%{name}.service -%{__install} -D -m 0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/sysconfig/%{name} -%{__install} -D -m 0600 %{SOURCE13} %{buildroot}%{_sysconfdir}/sudoers.d/%{name}-sudoers -%{__install} -D -m 0755 %{SOURCE14} %{buildroot}%{_libexecdir}/%{name}/restart.sh -%{__install} -D -m 0644 %{SOURCE16} %{buildroot}%{_prefix}/lib/firewalld/services/%{name}.xml - -%files -%{_libdir}/%{name}/jellyfin-web/* -%attr(755,root,root) %{_bindir}/%{name} -%{_libdir}/%{name}/*.json -%{_libdir}/%{name}/*.dll -%{_libdir}/%{name}/*.so -%{_libdir}/%{name}/*.a -%{_libdir}/%{name}/createdump -# Needs 755 else only root can run it since binary build by dotnet is 722 -%attr(755,root,root) %{_libdir}/%{name}/jellyfin -%{_libdir}/%{name}/SOS_README.md -%{_unitdir}/%{name}.service -%{_libexecdir}/%{name}/restart.sh -%{_prefix}/lib/firewalld/services/%{name}.xml -%attr(755,jellyfin,jellyfin) %dir %{_sysconfdir}/%{name} -%config %{_sysconfdir}/sysconfig/%{name} -%config(noreplace) %attr(600,root,root) %{_sysconfdir}/sudoers.d/%{name}-sudoers -%config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/override.conf -%config(noreplace) %attr(644,jellyfin,jellyfin) %{_sysconfdir}/%{name}/logging.json -%attr(750,jellyfin,jellyfin) %dir %{_sharedstatedir}/jellyfin -%attr(-,jellyfin,jellyfin) %dir %{_var}/log/jellyfin -%attr(750,jellyfin,jellyfin) %dir %{_var}/cache/jellyfin -%if 0%{?fedora} -%license LICENSE -%else -%{_datadir}/licenses/%{name}/LICENSE -%endif - -%pre -getent group jellyfin >/dev/null || groupadd -r jellyfin -getent passwd jellyfin >/dev/null || \ - useradd -r -g jellyfin -d %{_sharedstatedir}/jellyfin -s /sbin/nologin \ - -c "Jellyfin default user" jellyfin -exit 0 - -%post -# Move existing configuration cache and logs to their new locations and symlink them. -if [ $1 -gt 1 ] ; then - service_state=$(systemctl is-active jellyfin.service) - if [ "${service_state}" = "active" ]; then - systemctl stop jellyfin.service - fi - if [ ! -L %{_sharedstatedir}/%{name}/config ]; then - mv %{_sharedstatedir}/%{name}/config/* %{_sysconfdir}/%{name}/ - rmdir %{_sharedstatedir}/%{name}/config - ln -sf %{_sysconfdir}/%{name} %{_sharedstatedir}/%{name}/config - fi - if [ ! -L %{_sharedstatedir}/%{name}/logs ]; then - mv %{_sharedstatedir}/%{name}/logs/* %{_var}/log/jellyfin - rmdir %{_sharedstatedir}/%{name}/logs - ln -sf %{_var}/log/jellyfin %{_sharedstatedir}/%{name}/logs - fi - if [ ! -L %{_sharedstatedir}/%{name}/cache ]; then - mv %{_sharedstatedir}/%{name}/cache/* %{_var}/cache/jellyfin - rmdir %{_sharedstatedir}/%{name}/cache - ln -sf %{_var}/cache/jellyfin %{_sharedstatedir}/%{name}/cache - fi - if [ "${service_state}" = "active" ]; then - systemctl start jellyfin.service - fi -fi -%systemd_post jellyfin.service - -%preun -%systemd_preun jellyfin.service - -%postun -%systemd_postun_with_restart jellyfin.service - -%changelog -* Fri Oct 11 2019 Jellyfin Packaging Team -- New upstream version 10.5.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.5.0 -* Sat Aug 31 2019 Jellyfin Packaging Team -- New upstream version 10.4.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.4.0 -* Wed Jul 24 2019 Jellyfin Packaging Team -- New upstream version 10.3.7; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.7 -* Sat Jul 06 2019 Jellyfin Packaging Team -- New upstream version 10.3.6; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.6 -* Sun Jun 09 2019 Jellyfin Packaging Team -- New upstream version 10.3.5; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.5 -* Thu Jun 06 2019 Jellyfin Packaging Team -- New upstream version 10.3.4; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.4 -* Fri May 17 2019 Jellyfin Packaging Team -- New upstream version 10.3.3; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.3 -* Tue Apr 30 2019 Jellyfin Packaging Team -- New upstream version 10.3.2; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.2 -* Sat Apr 20 2019 Jellyfin Packaging Team -- New upstream version 10.3.1; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.1 -* Fri Apr 19 2019 Jellyfin Packaging Team -- New upstream version 10.3.0; release changelog at https://github.com/jellyfin/jellyfin/releases/tag/v10.3.0 diff --git a/deployment/old/fedora-package-x64/pkg-src/jellyfin.sudoers b/deployment/old/fedora-package-x64/pkg-src/jellyfin.sudoers deleted file mode 100644 index dd245af4b8..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/jellyfin.sudoers +++ /dev/null @@ -1,19 +0,0 @@ -# Allow jellyfin group to start, stop and restart itself -Cmnd_Alias RESTARTSERVER_SYSTEMD = /usr/bin/systemctl restart jellyfin, /bin/systemctl restart jellyfin -Cmnd_Alias STARTSERVER_SYSTEMD = /usr/bin/systemctl start jellyfin, /bin/systemctl start jellyfin -Cmnd_Alias STOPSERVER_SYSTEMD = /usr/bin/systemctl stop jellyfin, /bin/systemctl stop jellyfin - - -jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSTEMD -jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSTEMD -jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSTEMD - -Defaults!RESTARTSERVER_SYSTEMD !requiretty -Defaults!STARTSERVER_SYSTEMD !requiretty -Defaults!STOPSERVER_SYSTEMD !requiretty - -# Allow the server to mount iso images -jellyfin ALL=(ALL) NOPASSWD: /bin/mount -jellyfin ALL=(ALL) NOPASSWD: /bin/umount - -Defaults:jellyfin !requiretty diff --git a/deployment/old/fedora-package-x64/pkg-src/restart.sh b/deployment/old/fedora-package-x64/pkg-src/restart.sh deleted file mode 100755 index 9b64b6d728..0000000000 --- a/deployment/old/fedora-package-x64/pkg-src/restart.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# restart.sh - Jellyfin server restart script -# Part of the Jellyfin project (https://github.com/jellyfin) -# -# This script restarts the Jellyfin daemon on Linux when using -# the Restart button on the admin dashboard. It supports the -# systemctl, service, and traditional /etc/init.d (sysv) restart -# methods, chosen automatically by which one is found first (in -# that order). -# -# This script is used by the Debian/Ubuntu/Fedora/CentOS packages. - -get_service_command() { - for command in systemctl service; do - if which $command &>/dev/null; then - echo $command && return - fi - done - echo "sysv" -} - -cmd="$( get_service_command )" -echo "Detected service control platform '$cmd'; using it to restart Jellyfin..." -case $cmd in - 'systemctl') - echo "sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin" | at now - ;; - 'service') - echo "sleep 2; /usr/bin/sudo $( which service ) jellyfin restart" | at now - ;; - 'sysv') - echo "sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart" | at now - ;; -esac -exit 0 diff --git a/deployment/old/linux-x64/Dockerfile b/deployment/old/linux-x64/Dockerfile deleted file mode 100644 index c47057546d..0000000000 --- a/deployment/old/linux-x64/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/linux-x64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install yarn package manager -RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ - && apt update \ - && apt install -y yarn - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/linux-x64/clean.sh b/deployment/old/linux-x64/clean.sh deleted file mode 100755 index c07501a7bb..0000000000 --- a/deployment/old/linux-x64/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-linux-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/linux-x64/dependencies.txt b/deployment/old/linux-x64/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/linux-x64/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/linux-x64/docker-build.sh b/deployment/old/linux-x64/docker-build.sh deleted file mode 100755 index e33328a36a..0000000000 --- a/deployment/old/linux-x64/docker-build.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# Builds the TAR archive inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Clone down and build Web frontend -web_build_dir="$( mktemp -d )" -web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web" -git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/ -pushd ${web_build_dir} -if [[ -n ${web_branch} ]]; then - checkout -b origin/${web_branch} -fi -yarn install -mkdir -p ${web_target} -mv dist/* ${web_target}/ -popd -rm -rf ${web_build_dir} - -# Get version -version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" - -# Build archives -dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime linux-x64 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true" -tar -cvzf /jellyfin_${version}.portable.tar.gz -C /dist jellyfin_${version} -rm -rf /dist/jellyfin_${version} - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/ -mv /jellyfin[-_]*.tar.gz ${ARTIFACT_DIR}/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/linux-x64/package.sh b/deployment/old/linux-x64/package.sh deleted file mode 100755 index dfe8a9aa4a..0000000000 --- a/deployment/old/linux-x64/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-linux-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/* "${output_dir}" diff --git a/deployment/old/macos/Dockerfile b/deployment/old/macos/Dockerfile deleted file mode 100644 index b522df8848..0000000000 --- a/deployment/old/macos/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/macos -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install yarn package manager -RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ - && apt update \ - && apt install -y yarn - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/macos/clean.sh b/deployment/old/macos/clean.sh deleted file mode 100755 index c07501a7bb..0000000000 --- a/deployment/old/macos/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-linux-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/macos/dependencies.txt b/deployment/old/macos/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/macos/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/macos/docker-build.sh b/deployment/old/macos/docker-build.sh deleted file mode 100755 index f9417388d7..0000000000 --- a/deployment/old/macos/docker-build.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# Builds the TAR archive inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Clone down and build Web frontend -web_build_dir="$( mktemp -d )" -web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web" -git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/ -pushd ${web_build_dir} -if [[ -n ${web_branch} ]]; then - checkout -b origin/${web_branch} -fi -yarn install -mkdir -p ${web_target} -mv dist/* ${web_target}/ -popd -rm -rf ${web_build_dir} - -# Get version -version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" - -# Build archives -dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime osx-x64 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true" -tar -cvzf /jellyfin_${version}.portable.tar.gz -C /dist jellyfin_${version} -rm -rf /dist/jellyfin_${version} - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/ -mv /jellyfin[-_]*.tar.gz ${ARTIFACT_DIR}/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/macos/package.sh b/deployment/old/macos/package.sh deleted file mode 100755 index 464c0d382f..0000000000 --- a/deployment/old/macos/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-macos-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/* "${output_dir}" diff --git a/deployment/old/portable/Dockerfile b/deployment/old/portable/Dockerfile deleted file mode 100644 index 965eb82b86..0000000000 --- a/deployment/old/portable/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/portable -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install yarn package manager -RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ - && apt update \ - && apt install -y yarn - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/portable/clean.sh b/deployment/old/portable/clean.sh deleted file mode 100755 index c07501a7bb..0000000000 --- a/deployment/old/portable/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-linux-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/portable/dependencies.txt b/deployment/old/portable/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/portable/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/portable/docker-build.sh b/deployment/old/portable/docker-build.sh deleted file mode 100755 index 094190bbf6..0000000000 --- a/deployment/old/portable/docker-build.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# Builds the TAR archive inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Clone down and build Web frontend -web_build_dir="$( mktemp -d )" -web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web" -git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/ -pushd ${web_build_dir} -if [[ -n ${web_branch} ]]; then - checkout -b origin/${web_branch} -fi -yarn install -mkdir -p ${web_target} -mv dist/* ${web_target}/ -popd -rm -rf ${web_build_dir} - -# Get version -version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" - -# Build archives -dotnet publish Jellyfin.Server --configuration Release --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" -tar -cvzf /jellyfin_${version}.portable.tar.gz -C /dist jellyfin_${version} -rm -rf /dist/jellyfin_${version} - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/ -mv /jellyfin[-_]*.tar.gz ${ARTIFACT_DIR}/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/portable/package.sh b/deployment/old/portable/package.sh deleted file mode 100755 index 0ceb54dda1..0000000000 --- a/deployment/old/portable/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-portable-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/* "${output_dir}" diff --git a/deployment/old/ubuntu-package-arm64/Dockerfile.amd64 b/deployment/old/ubuntu-package-arm64/Dockerfile.amd64 deleted file mode 100644 index b11994a18a..0000000000 --- a/deployment/old/ubuntu-package-arm64/Dockerfile.amd64 +++ /dev/null @@ -1,59 +0,0 @@ -FROM ubuntu:bionic -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/ubuntu-package-arm64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install npm package manager -RUN wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ - && echo "deb https://deb.nodesource.com/node_10.x $(lsb_release -s -c) main" > /etc/apt/sources.list.d/npm.list \ - && apt update \ - && apt install -y nodejs - -# Prepare the cross-toolchain -RUN rm /etc/apt/sources.list \ - && export CODENAME="$( lsb_release -c -s )" \ - && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ - && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ - && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ - && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ - && echo "deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/arm64.list \ - && echo "deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/arm64.list \ - && echo "deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/arm64.list \ - && echo "deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/arm64.list \ - && dpkg --add-architecture arm64 \ - && apt-get update \ - && apt-get install -y cross-gcc-dev \ - && TARGET_LIST="arm64" cross-gcc-gensource 6 \ - && cd cross-gcc-packages-amd64/cross-gcc-6-arm64 \ - && ln -fs /usr/share/zoneinfo/America/Toronto /etc/localtime \ - && apt-get install -y gcc-6-source libstdc++6-arm64-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libcloog-isl-dev libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:arm64 linux-libc-dev:arm64 libgcc1:arm64 libcurl4-openssl-dev:arm64 libfontconfig1-dev:arm64 libfreetype6-dev:arm64 liblttng-ust0:arm64 libstdc++6:arm64 libssl-dev:arm64 - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/ubuntu-package-arm64/Dockerfile.arm64 b/deployment/old/ubuntu-package-arm64/Dockerfile.arm64 deleted file mode 100644 index 8f004b2f1a..0000000000 --- a/deployment/old/ubuntu-package-arm64/Dockerfile.arm64 +++ /dev/null @@ -1,40 +0,0 @@ -FROM ubuntu:bionic -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/ubuntu-package-arm64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=arm64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev liblttng-ust0 libssl-dev - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/5a4c8f96-1c73-401c-a6de-8e100403188a/0ce6ab39747e2508366d498f9c0a0669/dotnet-sdk-3.1.100-linux-arm64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install npm package manager -RUN wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ - && echo "deb https://deb.nodesource.com/node_10.x $(lsb_release -s -c) main" > /etc/apt/sources.list.d/npm.list \ - && apt update \ - && apt install -y nodejs - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/ubuntu-package-arm64/clean.sh b/deployment/old/ubuntu-package-arm64/clean.sh deleted file mode 100755 index 82d427f9e5..0000000000 --- a/deployment/old/ubuntu-package-arm64/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-ubuntu-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/ubuntu-package-arm64/dependencies.txt b/deployment/old/ubuntu-package-arm64/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/ubuntu-package-arm64/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/ubuntu-package-arm64/docker-build.sh b/deployment/old/ubuntu-package-arm64/docker-build.sh deleted file mode 100755 index 67ab6bd74b..0000000000 --- a/deployment/old/ubuntu-package-arm64/docker-build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Builds the DEB inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image -sed -i '/dotnet-sdk-3.1,/d' debian/control - -# Build DEB -export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} -dpkg-buildpackage -us -uc -aarm64 - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/deb -mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/ubuntu-package-arm64/package.sh b/deployment/old/ubuntu-package-arm64/package.sh deleted file mode 100755 index d1140a7274..0000000000 --- a/deployment/old/ubuntu-package-arm64/package.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -ARCH="$( arch )" -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-ubuntu_arm64-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Determine which Dockerfile to use -case $ARCH in - 'x86_64') - DOCKERFILE="Dockerfile.amd64" - ;; - 'armv7l') - DOCKERFILE="Dockerfile.arm64" - ;; -esac - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./${DOCKERFILE} -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/ubuntu-package-arm64/pkg-src b/deployment/old/ubuntu-package-arm64/pkg-src deleted file mode 120000 index 4c695fea17..0000000000 --- a/deployment/old/ubuntu-package-arm64/pkg-src +++ /dev/null @@ -1 +0,0 @@ -../debian-package-x64/pkg-src \ No newline at end of file diff --git a/deployment/old/ubuntu-package-armhf/Dockerfile.amd64 b/deployment/old/ubuntu-package-armhf/Dockerfile.amd64 deleted file mode 100644 index e475b14389..0000000000 --- a/deployment/old/ubuntu-package-armhf/Dockerfile.amd64 +++ /dev/null @@ -1,59 +0,0 @@ -FROM ubuntu:bionic -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/ubuntu-package-armhf -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install npm package manager -RUN wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ - && echo "deb https://deb.nodesource.com/node_10.x $(lsb_release -s -c) main" > /etc/apt/sources.list.d/npm.list \ - && apt update \ - && apt install -y nodejs - -# Prepare the cross-toolchain -RUN rm /etc/apt/sources.list \ - && export CODENAME="$( lsb_release -c -s )" \ - && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ - && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ - && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ - && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ - && echo "deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/armhf.list \ - && echo "deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/armhf.list \ - && echo "deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/armhf.list \ - && echo "deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/armhf.list \ - && dpkg --add-architecture armhf \ - && apt-get update \ - && apt-get install -y cross-gcc-dev \ - && TARGET_LIST="armhf" cross-gcc-gensource 6 \ - && cd cross-gcc-packages-amd64/cross-gcc-6-armhf \ - && ln -fs /usr/share/zoneinfo/America/Toronto /etc/localtime \ - && apt-get install -y gcc-6-source libstdc++6-armhf-cross binutils-arm-linux-gnueabihf bison flex libtool gdb sharutils netbase libcloog-isl-dev libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:armhf linux-libc-dev:armhf libgcc1:armhf libcurl4-openssl-dev:armhf libfontconfig1-dev:armhf libfreetype6-dev:armhf liblttng-ust0:armhf libstdc++6:armhf libssl-dev:armhf - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/ubuntu-package-armhf/Dockerfile.armhf b/deployment/old/ubuntu-package-armhf/Dockerfile.armhf deleted file mode 100644 index 0e71fa6938..0000000000 --- a/deployment/old/ubuntu-package-armhf/Dockerfile.armhf +++ /dev/null @@ -1,40 +0,0 @@ -FROM ubuntu:bionic -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/ubuntu-package-armhf -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=armhf - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev liblttng-ust0 libssl-dev - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/67766a96-eb8c-4cd2-bca4-ea63d2cc115c/7bf13840aa2ed88793b7315d5e0d74e6/dotnet-sdk-3.1.100-linux-arm.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install npm package manager -RUN wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ - && echo "deb https://deb.nodesource.com/node_10.x $(lsb_release -s -c) main" > /etc/apt/sources.list.d/npm.list \ - && apt update \ - && apt install -y nodejs - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -# Link to Debian source dir; mkdir needed or it fails, can't force dest -RUN mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/ubuntu-package-armhf/clean.sh b/deployment/old/ubuntu-package-armhf/clean.sh deleted file mode 100755 index 82d427f9e5..0000000000 --- a/deployment/old/ubuntu-package-armhf/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-ubuntu-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/ubuntu-package-armhf/dependencies.txt b/deployment/old/ubuntu-package-armhf/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/ubuntu-package-armhf/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/ubuntu-package-armhf/docker-build.sh b/deployment/old/ubuntu-package-armhf/docker-build.sh deleted file mode 100755 index 1bd7fb2911..0000000000 --- a/deployment/old/ubuntu-package-armhf/docker-build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Builds the DEB inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image -sed -i '/dotnet-sdk-3.1,/d' debian/control - -# Build DEB -export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} -dpkg-buildpackage -us -uc -aarmhf - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/deb -mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/ubuntu-package-armhf/package.sh b/deployment/old/ubuntu-package-armhf/package.sh deleted file mode 100755 index 2ceb3e8165..0000000000 --- a/deployment/old/ubuntu-package-armhf/package.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -ARCH="$( arch )" -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-ubuntu_armhf-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Determine which Dockerfile to use -case $ARCH in - 'x86_64') - DOCKERFILE="Dockerfile.amd64" - ;; - 'armv7l') - DOCKERFILE="Dockerfile.armhf" - ;; -esac - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./${DOCKERFILE} -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/ubuntu-package-armhf/pkg-src b/deployment/old/ubuntu-package-armhf/pkg-src deleted file mode 120000 index 4c695fea17..0000000000 --- a/deployment/old/ubuntu-package-armhf/pkg-src +++ /dev/null @@ -1 +0,0 @@ -../debian-package-x64/pkg-src \ No newline at end of file diff --git a/deployment/old/ubuntu-package-x64/Dockerfile b/deployment/old/ubuntu-package-x64/Dockerfile deleted file mode 100644 index e2dda6392c..0000000000 --- a/deployment/old/ubuntu-package-x64/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -FROM ubuntu:bionic -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/ubuntu-package-x64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Ubuntu build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev liblttng-ust0 \ - && ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh \ - && mkdir -p ${SOURCE_DIR} && ln -sf ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/debian - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install npm package manager -RUN wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ - && echo "deb https://deb.nodesource.com/node_10.x $(lsb_release -s -c) main" > /etc/apt/sources.list.d/npm.list \ - && apt update \ - && apt install -y nodejs - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/ubuntu-package-x64/clean.sh b/deployment/old/ubuntu-package-x64/clean.sh deleted file mode 100755 index 82d427f9e5..0000000000 --- a/deployment/old/ubuntu-package-x64/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-ubuntu-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/ubuntu-package-x64/dependencies.txt b/deployment/old/ubuntu-package-x64/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/ubuntu-package-x64/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/ubuntu-package-x64/docker-build.sh b/deployment/old/ubuntu-package-x64/docker-build.sh deleted file mode 100755 index 962a522ebc..0000000000 --- a/deployment/old/ubuntu-package-x64/docker-build.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# Builds the DEB inside the Docker container - -set -o errexit -set -o xtrace - -# Move to source directory -pushd ${SOURCE_DIR} - -# Remove build-dep for dotnet-sdk-3.1, since it's not a package in this image -sed -i '/dotnet-sdk-3.1,/d' debian/control - -# Build DEB -dpkg-buildpackage -us -uc - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/deb -mv /jellyfin[-_]* ${ARTIFACT_DIR}/deb/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/ubuntu-package-x64/package.sh b/deployment/old/ubuntu-package-x64/package.sh deleted file mode 100755 index 08c003778b..0000000000 --- a/deployment/old/ubuntu-package-x64/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-ubuntu-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/deb/* "${output_dir}" diff --git a/deployment/old/ubuntu-package-x64/pkg-src b/deployment/old/ubuntu-package-x64/pkg-src deleted file mode 120000 index 0bb6d55249..0000000000 --- a/deployment/old/ubuntu-package-x64/pkg-src +++ /dev/null @@ -1 +0,0 @@ -../debian-package-x64/pkg-src/ \ No newline at end of file diff --git a/deployment/old/unraid/docker-templates/README.md b/deployment/old/unraid/docker-templates/README.md deleted file mode 100644 index 2c268e8b3e..0000000000 --- a/deployment/old/unraid/docker-templates/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# docker-templates - -### Installation: - -Open unRaid GUI (at least unRaid 6.5) - -Click on the Docker tab - -Add the following line under "Template Repositories" - -https://github.com/jellyfin/jellyfin/blob/master/deployment/unraid/docker-templates - -Click save than click on Add Container and select jellyfin. - -Adjust to your paths to your liking and off you go! diff --git a/deployment/old/unraid/docker-templates/jellyfin.xml b/deployment/old/unraid/docker-templates/jellyfin.xml deleted file mode 100644 index 57b4cc5ae1..0000000000 --- a/deployment/old/unraid/docker-templates/jellyfin.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - https://raw.githubusercontent.com/jellyfin/jellyfin/deployment/unraid/docker-templates/jellyfin.xml - False - MediaApp:Video MediaApp:Music MediaApp:Photos MediaServer:Video MediaServer:Music MediaServer:Photos - Jellyfin - - Jellyfin is The Free Software Media Browser Converted By Community Applications Always verify this template (and values) against the dockerhub support page for the container!![br][br] - You can add as many mount points as needed for recordings, movies ,etc. [br][br] - [b][span style='color: #E80000;']Directions:[/span][/b][br] - [b]/config[/b] : This is where Jellyfin will store it's databases and configuration.[br][br] - [b]Port[/b] : This is the default port for Jellyfin. (Will add ssl port later)[br][br] - [b]Media[/b] : This is the mounting point of your media. When you access it in Jellyfin it will be /media or whatever you chose for a mount point[br][br] - [b]Cache[/b] : This is where Jellyfin will store and manage cached files like images to serve to clients. This is not where all images are stored.[br][br] - [b]Tip:[/b] You can add more volume mappings if you wish Jellyfin has access to it. - - - Jellyfin Server is a home media server built on top of other popular open source technologies such as Service Stack, jQuery, jQuery mobile, and Mono and will remain completely free! - - https://www.reddit.com/r/jellyfin/ - https://hub.docker.com/r/jellyfin/jellyfin/ - https://github.com/jellyfin/jellyfin/> - jellyfin/jellyfin - https://jellyfin.media/ - true - false - - host - - - 8096 - 8096 - tcp - - - - - - /mnt/user/appdata/Jellyfin - /config - rw - - - /mnt/user - /media - rw - - - /mnt/user/appdata/Jellyfin/cache/ - /cache - rw - - - http://[IP]:[PORT:8096]/ - https://raw.githubusercontent.com/binhex/docker-templates/master/binhex/images/jellyfin-icon.png - - diff --git a/deployment/old/win-x64/Dockerfile b/deployment/old/win-x64/Dockerfile deleted file mode 100644 index 8a33749541..0000000000 --- a/deployment/old/win-x64/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/win-x64 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 zip - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install yarn package manager -RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ - && apt update \ - && apt install -y yarn - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/win-x64/clean.sh b/deployment/old/win-x64/clean.sh deleted file mode 100755 index 6c183f3371..0000000000 --- a/deployment/old/win-x64/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-windows-x64-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/win-x64/dependencies.txt b/deployment/old/win-x64/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/win-x64/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/win-x64/docker-build.sh b/deployment/old/win-x64/docker-build.sh deleted file mode 100755 index 79e5fb0bcd..0000000000 --- a/deployment/old/win-x64/docker-build.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -# Builds the ZIP archive inside the Docker container - -set -o errexit -set -o xtrace - -# Version variables -NSSM_VERSION="nssm-2.24-101-g897c7ad" -NSSM_URL="http://files.evilt.win/nssm/${NSSM_VERSION}.zip" -FFMPEG_VERSION="ffmpeg-4.2.1-win64-static" -FFMPEG_URL="https://ffmpeg.zeranoe.com/builds/win64/static/${FFMPEG_VERSION}.zip" - -# Move to source directory -pushd ${SOURCE_DIR} - -# Clone down and build Web frontend -web_build_dir="$( mktemp -d )" -web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web" -git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/ -pushd ${web_build_dir} -if [[ -n ${web_branch} ]]; then - checkout -b origin/${web_branch} -fi -yarn install -mkdir -p ${web_target} -mv dist/* ${web_target}/ -popd -rm -rf ${web_build_dir} - -# Get version -version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" - -# Build binary -dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime win-x64 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true" - -# Prepare addins -addin_build_dir="$( mktemp -d )" -wget ${NSSM_URL} -O ${addin_build_dir}/nssm.zip -wget ${FFMPEG_URL} -O ${addin_build_dir}/ffmpeg.zip -unzip ${addin_build_dir}/nssm.zip -d ${addin_build_dir} -cp ${addin_build_dir}/${NSSM_VERSION}/win64/nssm.exe /dist/jellyfin_${version}/nssm.exe -unzip ${addin_build_dir}/ffmpeg.zip -d ${addin_build_dir} -cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffmpeg.exe /dist/jellyfin_${version}/ffmpeg.exe -cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffprobe.exe /dist/jellyfin_${version}/ffprobe.exe -rm -rf ${addin_build_dir} - -# Prepare scripts -cp ${SOURCE_DIR}/deployment/windows/legacy/install-jellyfin.ps1 /dist/jellyfin_${version}/install-jellyfin.ps1 -cp ${SOURCE_DIR}/deployment/windows/legacy/install.bat /dist/jellyfin_${version}/install.bat - -# Create zip package -pushd /dist -zip -r /jellyfin_${version}.portable.zip jellyfin_${version} -popd -rm -rf /dist/jellyfin_${version} - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/ -mv /jellyfin[-_]*.zip ${ARTIFACT_DIR}/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/win-x64/package.sh b/deployment/old/win-x64/package.sh deleted file mode 100755 index a8ab190fa5..0000000000 --- a/deployment/old/win-x64/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-windows-x64-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/* "${output_dir}" diff --git a/deployment/old/win-x86/Dockerfile b/deployment/old/win-x86/Dockerfile deleted file mode 100644 index f8dc5be83d..0000000000 --- a/deployment/old/win-x86/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM debian:10 -# Docker build arguments -ARG SOURCE_DIR=/jellyfin -ARG PLATFORM_DIR=/jellyfin/deployment/win-x86 -ARG ARTIFACT_DIR=/dist -ARG SDK_VERSION=3.1 -# Docker run environment -ENV SOURCE_DIR=/jellyfin -ENV ARTIFACT_DIR=/dist -ENV DEB_BUILD_OPTIONS=noddebs -ENV ARCH=amd64 - -# Prepare Debian build environment -RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 zip - -# Install dotnet repository -# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current -RUN wget https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ - && mkdir -p dotnet-sdk \ - && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ - && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet - -# Install yarn package manager -RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ - && apt update \ - && apt install -y yarn - -# Link to docker-build script -RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh - -VOLUME ${ARTIFACT_DIR}/ - -COPY . ${SOURCE_DIR}/ - -ENTRYPOINT ["/docker-build.sh"] diff --git a/deployment/old/win-x86/clean.sh b/deployment/old/win-x86/clean.sh deleted file mode 100755 index 8b78c5e4b6..0000000000 --- a/deployment/old/win-x86/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -keep_artifacts="${1}" - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-windows-x86-build" - -rm -rf "${package_temporary_dir}" &>/dev/null \ - || sudo rm -rf "${package_temporary_dir}" &>/dev/null - -rm -rf "${output_dir}" &>/dev/null \ - || sudo rm -rf "${output_dir}" &>/dev/null - -if [[ ${keep_artifacts} == 'n' ]]; then - docker_sudo="" - if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo=sudo - fi - ${docker_sudo} docker image rm ${image_name} --force -fi diff --git a/deployment/old/win-x86/dependencies.txt b/deployment/old/win-x86/dependencies.txt deleted file mode 100644 index bdb9670965..0000000000 --- a/deployment/old/win-x86/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/old/win-x86/docker-build.sh b/deployment/old/win-x86/docker-build.sh deleted file mode 100755 index 977dcf78fa..0000000000 --- a/deployment/old/win-x86/docker-build.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -# Builds the ZIP archive inside the Docker container - -set -o errexit -set -o xtrace - -# Version variables -NSSM_VERSION="nssm-2.24-101-g897c7ad" -NSSM_URL="http://files.evilt.win/nssm/${NSSM_VERSION}.zip" -FFMPEG_VERSION="ffmpeg-4.2.1-win32-static" -FFMPEG_URL="https://ffmpeg.zeranoe.com/builds/win32/static/${FFMPEG_VERSION}.zip" - -# Move to source directory -pushd ${SOURCE_DIR} - -# Clone down and build Web frontend -web_build_dir="$( mktemp -d )" -web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web" -git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/ -pushd ${web_build_dir} -if [[ -n ${web_branch} ]]; then - checkout -b origin/${web_branch} -fi -yarn install -mkdir -p ${web_target} -mv dist/* ${web_target}/ -popd -rm -rf ${web_build_dir} - -# Get version -version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" - -# Build binary -dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime win-x86 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true" - -# Prepare addins -addin_build_dir="$( mktemp -d )" -wget ${NSSM_URL} -O ${addin_build_dir}/nssm.zip -wget ${FFMPEG_URL} -O ${addin_build_dir}/ffmpeg.zip -unzip ${addin_build_dir}/nssm.zip -d ${addin_build_dir} -cp ${addin_build_dir}/${NSSM_VERSION}/win64/nssm.exe /dist/jellyfin_${version}/nssm.exe -unzip ${addin_build_dir}/ffmpeg.zip -d ${addin_build_dir} -cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffmpeg.exe /dist/jellyfin_${version}/ffmpeg.exe -cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffprobe.exe /dist/jellyfin_${version}/ffprobe.exe -rm -rf ${addin_build_dir} - -# Prepare scripts -cp ${SOURCE_DIR}/deployment/windows/legacy/install-jellyfin.ps1 /dist/jellyfin_${version}/install-jellyfin.ps1 -cp ${SOURCE_DIR}/deployment/windows/legacy/install.bat /dist/jellyfin_${version}/install.bat - -# Create zip package -pushd /dist -zip -r /jellyfin_${version}.portable.zip jellyfin_${version} -popd -rm -rf /dist/jellyfin_${version} - -# Move the artifacts out -mkdir -p ${ARTIFACT_DIR}/ -mv /jellyfin[-_]*.zip ${ARTIFACT_DIR}/ -chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} diff --git a/deployment/old/win-x86/package.sh b/deployment/old/win-x86/package.sh deleted file mode 100755 index 65e7e2928c..0000000000 --- a/deployment/old/win-x86/package.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -args="${@}" -declare -a docker_envvars -for arg in ${args}; do - docker_envvars+=("-e ${arg}") -done - -WORKDIR="$( pwd )" - -package_temporary_dir="${WORKDIR}/pkg-dist-tmp" -output_dir="${WORKDIR}/pkg-dist" -current_user="$( whoami )" -image_name="jellyfin-windows-x86-build" - -# Determine if sudo should be used for Docker -if [[ ! -z $(id -Gn | grep -q 'docker') ]] \ - && [[ ! ${EUID:-1000} -eq 0 ]] \ - && [[ ! ${USER} == "root" ]] \ - && [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then - docker_sudo="sudo" -else - docker_sudo="" -fi - -# Prepare temporary package dir -mkdir -p "${package_temporary_dir}" -# Set up the build environment Docker image -${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile -# Build the DEBs and copy out to ${package_temporary_dir} -${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars} -# Move the DEBs to the output directory -mkdir -p "${output_dir}" -mv "${package_temporary_dir}"/* "${output_dir}" From 762a46045ee784c500f7fe4c2c0131ca83e8b50e Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 9 Apr 2020 11:55:14 -0400 Subject: [PATCH 051/115] Update gitignore paths for debian/ --- .gitignore | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 17cf4a6277..f3ad8c09bd 100644 --- a/.gitignore +++ b/.gitignore @@ -244,14 +244,14 @@ pip-log.txt ######################### # Artifacts for debian-x64 -deployment/debian-package-x64/pkg-src/.debhelper/ -deployment/debian-package-x64/pkg-src/*.debhelper -deployment/debian-package-x64/pkg-src/debhelper-build-stamp -deployment/debian-package-x64/pkg-src/files -deployment/debian-package-x64/pkg-src/jellyfin.substvars -deployment/debian-package-x64/pkg-src/jellyfin/ +debian/.debhelper/ +debian/*.debhelper +debian/debhelper-build-stamp +debian/files +debian/jellyfin.substvars +debian/jellyfin/ # Don't ignore the debian/bin folder -!deployment/debian-package-x64/pkg-src/bin/ +!debian/bin/ deployment/**/dist/ deployment/**/pkg-dist/ From 7eac3684862380a857edc6c7e98c20f25c5b9a03 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 9 Apr 2020 11:55:27 -0400 Subject: [PATCH 052/115] Fix missing restart script --- debian/bin/restart.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 debian/bin/restart.sh diff --git a/debian/bin/restart.sh b/debian/bin/restart.sh new file mode 100755 index 0000000000..9b64b6d728 --- /dev/null +++ b/debian/bin/restart.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# restart.sh - Jellyfin server restart script +# Part of the Jellyfin project (https://github.com/jellyfin) +# +# This script restarts the Jellyfin daemon on Linux when using +# the Restart button on the admin dashboard. It supports the +# systemctl, service, and traditional /etc/init.d (sysv) restart +# methods, chosen automatically by which one is found first (in +# that order). +# +# This script is used by the Debian/Ubuntu/Fedora/CentOS packages. + +get_service_command() { + for command in systemctl service; do + if which $command &>/dev/null; then + echo $command && return + fi + done + echo "sysv" +} + +cmd="$( get_service_command )" +echo "Detected service control platform '$cmd'; using it to restart Jellyfin..." +case $cmd in + 'systemctl') + echo "sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin" | at now + ;; + 'service') + echo "sleep 2; /usr/bin/sudo $( which service ) jellyfin restart" | at now + ;; + 'sysv') + echo "sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart" | at now + ;; +esac +exit 0 From 4d949cb38b531455bc42551a7c095a0c2a00170e Mon Sep 17 00:00:00 2001 From: hauntingEcho <1661988+hauntingEcho@users.noreply.github.com> Date: Tue, 31 Mar 2020 21:41:10 -0500 Subject: [PATCH 053/115] Specify a version for jellyfin-ffmpeg dependency in .deb Lower versions cause #2126 in Jellyfin >= 10.4.3 --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 5559700cf5..896d8286b7 100644 --- a/debian/control +++ b/debian/control @@ -21,7 +21,7 @@ Conflicts: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server Architecture: any Depends: at, libsqlite3-0, - jellyfin-ffmpeg, + jellyfin-ffmpeg (>= 4.2.1-2), libfontconfig1, libfreetype6, libssl1.1 From 4e894b4b660f33e8c8a6ce9b235edaaf313b9c9e Mon Sep 17 00:00:00 2001 From: ferferga Date: Thu, 9 Apr 2020 18:23:21 +0200 Subject: [PATCH 054/115] Remove unnecessary space in hardware decoders argument for ffmpeg --- .../MediaEncoding/EncodingHelper.cs | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 95b7df9bd6..3fb8c825a6 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -2549,7 +2549,7 @@ namespace MediaBrowser.Controller.MediaEncoding encodingOptions.HardwareDecodingCodecs = Array.Empty(); return null; } - return "-c:v h264_qsv "; + return "-c:v h264_qsv"; } break; case "hevc": @@ -2557,19 +2557,19 @@ namespace MediaBrowser.Controller.MediaEncoding if (_mediaEncoder.SupportsDecoder("hevc_qsv") && encodingOptions.HardwareDecodingCodecs.Contains("hevc", StringComparer.OrdinalIgnoreCase)) { //return "-c:v hevc_qsv -load_plugin hevc_hw "; - return "-c:v hevc_qsv "; + return "-c:v hevc_qsv"; } break; case "mpeg2video": if (_mediaEncoder.SupportsDecoder("mpeg2_qsv") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg2video", StringComparer.OrdinalIgnoreCase)) { - return "-c:v mpeg2_qsv "; + return "-c:v mpeg2_qsv"; } break; case "vc1": if (_mediaEncoder.SupportsDecoder("vc1_qsv") && encodingOptions.HardwareDecodingCodecs.Contains("vc1", StringComparer.OrdinalIgnoreCase)) { - return "-c:v vc1_qsv "; + return "-c:v vc1_qsv"; } break; } @@ -2589,32 +2589,32 @@ namespace MediaBrowser.Controller.MediaEncoding encodingOptions.HardwareDecodingCodecs = Array.Empty(); return null; } - return "-c:v h264_cuvid "; + return "-c:v h264_cuvid"; } break; case "hevc": case "h265": if (_mediaEncoder.SupportsDecoder("hevc_cuvid") && encodingOptions.HardwareDecodingCodecs.Contains("hevc", StringComparer.OrdinalIgnoreCase)) { - return "-c:v hevc_cuvid "; + return "-c:v hevc_cuvid"; } break; case "mpeg2video": if (_mediaEncoder.SupportsDecoder("mpeg2_cuvid") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg2video", StringComparer.OrdinalIgnoreCase)) { - return "-c:v mpeg2_cuvid "; + return "-c:v mpeg2_cuvid"; } break; case "vc1": if (_mediaEncoder.SupportsDecoder("vc1_cuvid") && encodingOptions.HardwareDecodingCodecs.Contains("vc1", StringComparer.OrdinalIgnoreCase)) { - return "-c:v vc1_cuvid "; + return "-c:v vc1_cuvid"; } break; case "mpeg4": if (_mediaEncoder.SupportsDecoder("mpeg4_cuvid") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg4", StringComparer.OrdinalIgnoreCase)) { - return "-c:v mpeg4_cuvid "; + return "-c:v mpeg4_cuvid"; } break; } @@ -2628,38 +2628,38 @@ namespace MediaBrowser.Controller.MediaEncoding case "h264": if (_mediaEncoder.SupportsDecoder("h264_mediacodec") && encodingOptions.HardwareDecodingCodecs.Contains("h264", StringComparer.OrdinalIgnoreCase)) { - return "-c:v h264_mediacodec "; + return "-c:v h264_mediacodec"; } break; case "hevc": case "h265": if (_mediaEncoder.SupportsDecoder("hevc_mediacodec") && encodingOptions.HardwareDecodingCodecs.Contains("hevc", StringComparer.OrdinalIgnoreCase)) { - return "-c:v hevc_mediacodec "; + return "-c:v hevc_mediacodec"; } break; case "mpeg2video": if (_mediaEncoder.SupportsDecoder("mpeg2_mediacodec") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg2video", StringComparer.OrdinalIgnoreCase)) { - return "-c:v mpeg2_mediacodec "; + return "-c:v mpeg2_mediacodec"; } break; case "mpeg4": if (_mediaEncoder.SupportsDecoder("mpeg4_mediacodec") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg4", StringComparer.OrdinalIgnoreCase)) { - return "-c:v mpeg4_mediacodec "; + return "-c:v mpeg4_mediacodec"; } break; case "vp8": if (_mediaEncoder.SupportsDecoder("vp8_mediacodec") && encodingOptions.HardwareDecodingCodecs.Contains("vp8", StringComparer.OrdinalIgnoreCase)) { - return "-c:v vp8_mediacodec "; + return "-c:v vp8_mediacodec"; } break; case "vp9": if (_mediaEncoder.SupportsDecoder("vp9_mediacodec") && encodingOptions.HardwareDecodingCodecs.Contains("vp9", StringComparer.OrdinalIgnoreCase)) { - return "-c:v vp9_mediacodec "; + return "-c:v vp9_mediacodec"; } break; } @@ -2673,25 +2673,25 @@ namespace MediaBrowser.Controller.MediaEncoding case "h264": if (_mediaEncoder.SupportsDecoder("h264_mmal") && encodingOptions.HardwareDecodingCodecs.Contains("h264", StringComparer.OrdinalIgnoreCase)) { - return "-c:v h264_mmal "; + return "-c:v h264_mmal"; } break; case "mpeg2video": if (_mediaEncoder.SupportsDecoder("mpeg2_mmal") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg2video", StringComparer.OrdinalIgnoreCase)) { - return "-c:v mpeg2_mmal "; + return "-c:v mpeg2_mmal"; } break; case "mpeg4": if (_mediaEncoder.SupportsDecoder("mpeg4_mmal") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg4", StringComparer.OrdinalIgnoreCase)) { - return "-c:v mpeg4_mmal "; + return "-c:v mpeg4_mmal"; } break; case "vc1": if (_mediaEncoder.SupportsDecoder("vc1_mmal") && encodingOptions.HardwareDecodingCodecs.Contains("vc1", StringComparer.OrdinalIgnoreCase)) { - return "-c:v vc1_mmal "; + return "-c:v vc1_mmal"; } break; } From 9c679b657045734eef9cbd1c2160602592a30b41 Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 14 Apr 2020 14:45:57 -0400 Subject: [PATCH 055/115] Clean up and document ActivityLogEntryPoint.cs --- .../Activity/ActivityLogEntryPoint.cs | 79 +++++++------------ 1 file changed, 30 insertions(+), 49 deletions(-) diff --git a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs index d900520b2a..e025417d13 100644 --- a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs +++ b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs @@ -1,5 +1,3 @@ -#pragma warning disable CS1591 - using System; using System.Collections.Generic; using System.Globalization; @@ -27,6 +25,10 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Activity { + /// + /// The activity log entry point. + /// . + /// public sealed class ActivityLogEntryPoint : IServerEntryPoint { private readonly ILogger _logger; @@ -42,16 +44,15 @@ namespace Emby.Server.Implementations.Activity /// /// Initializes a new instance of the class. /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// + /// The logger. + /// The session manager. + /// The device manager. + /// The task manager. + /// The activity manager. + /// The localization manager. + /// The installation manager. + /// The subtitle manager. + /// The user manager. public ActivityLogEntryPoint( ILogger logger, ISessionManager sessionManager, @@ -74,6 +75,7 @@ namespace Emby.Server.Implementations.Activity _userManager = userManager; } + /// public Task RunAsync() { _taskManager.TaskCompleted += OnTaskCompleted; @@ -136,7 +138,7 @@ namespace Emby.Server.Implementations.Activity CultureInfo.InvariantCulture, _localization.GetLocalizedString("SubtitleDownloadFailureFromForItem"), e.Provider, - Emby.Notifications.NotificationEntryPoint.GetItemName(e.Item)), + Notifications.NotificationEntryPoint.GetItemName(e.Item)), Type = "SubtitleDownloadFailure", ItemId = e.Item.Id.ToString("N", CultureInfo.InvariantCulture), ShortOverview = e.Exception.Message @@ -259,31 +261,20 @@ namespace Emby.Server.Implementations.Activity private void OnSessionEnded(object sender, SessionEventArgs e) { - string name; var session = e.SessionInfo; if (string.IsNullOrEmpty(session.UserName)) { - name = string.Format( - CultureInfo.InvariantCulture, - _localization.GetLocalizedString("DeviceOfflineWithName"), - session.DeviceName); - - // Causing too much spam for now return; } - else - { - name = string.Format( - CultureInfo.InvariantCulture, - _localization.GetLocalizedString("UserOfflineFromDevice"), - session.UserName, - session.DeviceName); - } CreateLogEntry(new ActivityLogEntry { - Name = name, + Name = string.Format( + CultureInfo.InvariantCulture, + _localization.GetLocalizedString("UserOfflineFromDevice"), + session.UserName, + session.DeviceName), Type = "SessionEnded", ShortOverview = string.Format( CultureInfo.InvariantCulture, @@ -382,31 +373,20 @@ namespace Emby.Server.Implementations.Activity private void OnSessionStarted(object sender, SessionEventArgs e) { - string name; var session = e.SessionInfo; if (string.IsNullOrEmpty(session.UserName)) { - name = string.Format( - CultureInfo.InvariantCulture, - _localization.GetLocalizedString("DeviceOnlineWithName"), - session.DeviceName); - - // Causing too much spam for now return; } - else - { - name = string.Format( - CultureInfo.InvariantCulture, - _localization.GetLocalizedString("UserOnlineFromDevice"), - session.UserName, - session.DeviceName); - } CreateLogEntry(new ActivityLogEntry { - Name = name, + Name = string.Format( + CultureInfo.InvariantCulture, + _localization.GetLocalizedString("UserOnlineFromDevice"), + session.UserName, + session.DeviceName), Type = "SessionStarted", ShortOverview = string.Format( CultureInfo.InvariantCulture, @@ -485,8 +465,7 @@ namespace Emby.Server.Implementations.Activity var result = e.Result; var task = e.Task; - var activityTask = task.ScheduledTask as IConfigurableScheduledTask; - if (activityTask != null && !activityTask.IsLogged) + if (task.ScheduledTask is IConfigurableScheduledTask activityTask && !activityTask.IsLogged) { return; } @@ -560,6 +539,8 @@ namespace Emby.Server.Implementations.Activity /// /// Constructs a user-friendly string for this TimeSpan instance. /// + /// The timespan. + /// The user-friendly string. public static string ToUserFriendlyString(TimeSpan span) { const int DaysInYear = 365; @@ -574,7 +555,7 @@ namespace Emby.Server.Implementations.Activity { int years = days / DaysInYear; values.Add(CreateValueString(years, "year")); - days = days % DaysInYear; + days %= DaysInYear; } // Number of months @@ -582,7 +563,7 @@ namespace Emby.Server.Implementations.Activity { int months = days / DaysInMonth; values.Add(CreateValueString(months, "month")); - days = days % DaysInMonth; + days %= DaysInMonth; } // Number of days From af4d617df22301d2740f1286727280bc1865f889 Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 14 Apr 2020 14:50:19 -0400 Subject: [PATCH 056/115] Clean up and document ActivityManager.cs --- .../Activity/ActivityManager.cs | 16 ++++++++++------ Emby.Server.Implementations/ApplicationHost.cs | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Emby.Server.Implementations/Activity/ActivityManager.cs b/Emby.Server.Implementations/Activity/ActivityManager.cs index ee10845cfa..2d2dc8e61e 100644 --- a/Emby.Server.Implementations/Activity/ActivityManager.cs +++ b/Emby.Server.Implementations/Activity/ActivityManager.cs @@ -1,32 +1,34 @@ -#pragma warning disable CS1591 - using System; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Activity; using MediaBrowser.Model.Events; using MediaBrowser.Model.Querying; -using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Activity { + /// public class ActivityManager : IActivityManager { + /// public event EventHandler> EntryCreated; private readonly IActivityRepository _repo; - private readonly ILogger _logger; private readonly IUserManager _userManager; + /// + /// Initializes a new instance of the class. + /// + /// The activity repository. + /// The user manager. public ActivityManager( - ILoggerFactory loggerFactory, IActivityRepository repo, IUserManager userManager) { - _logger = loggerFactory.CreateLogger(nameof(ActivityManager)); _repo = repo; _userManager = userManager; } + /// public void Create(ActivityLogEntry entry) { entry.Date = DateTime.UtcNow; @@ -36,6 +38,7 @@ namespace Emby.Server.Implementations.Activity EntryCreated?.Invoke(this, new GenericEventArgs(entry)); } + /// public QueryResult GetActivityLogEntries(DateTime? minDate, bool? hasUserId, int? startIndex, int? limit) { var result = _repo.GetActivityLogEntries(minDate, hasUserId, startIndex, limit); @@ -59,6 +62,7 @@ namespace Emby.Server.Implementations.Activity return result; } + /// public QueryResult GetActivityLogEntries(DateTime? minDate, int? startIndex, int? limit) { return GetActivityLogEntries(minDate, null, startIndex, limit); diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 81a80ddb26..7e80900f49 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -833,7 +833,7 @@ namespace Emby.Server.Implementations var activityLogRepo = GetActivityLogRepository(); serviceCollection.AddSingleton(activityLogRepo); - serviceCollection.AddSingleton(new ActivityManager(LoggerFactory, activityLogRepo, UserManager)); + serviceCollection.AddSingleton(new ActivityManager(activityLogRepo, UserManager)); var authContext = new AuthorizationContext(AuthenticationRepository, UserManager); serviceCollection.AddSingleton(authContext); From f6899de33850ddd6ccfc4262bc6c2fd836bfc32d Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 14 Apr 2020 15:04:54 -0400 Subject: [PATCH 057/115] Clean up and document ActivityRepository.cs --- .../Activity/ActivityRepository.cs | 184 +++++++++--------- 1 file changed, 89 insertions(+), 95 deletions(-) diff --git a/Emby.Server.Implementations/Activity/ActivityRepository.cs b/Emby.Server.Implementations/Activity/ActivityRepository.cs index 7be72319ea..697ad7fcc0 100644 --- a/Emby.Server.Implementations/Activity/ActivityRepository.cs +++ b/Emby.Server.Implementations/Activity/ActivityRepository.cs @@ -1,5 +1,3 @@ -#pragma warning disable CS1591 - using System; using System.Collections.Generic; using System.Globalization; @@ -15,11 +13,18 @@ using SQLitePCL.pretty; namespace Emby.Server.Implementations.Activity { + /// public class ActivityRepository : BaseSqliteRepository, IActivityRepository { private static readonly CultureInfo _usCulture = CultureInfo.ReadOnly(new CultureInfo("en-US")); private readonly IFileSystem _fileSystem; + /// + /// Initializes a new instance of the class. + /// + /// The logger factory. + /// The server application paths. + /// The filesystem. public ActivityRepository(ILoggerFactory loggerFactory, IServerApplicationPaths appPaths, IFileSystem fileSystem) : base(loggerFactory.CreateLogger(nameof(ActivityRepository))) { @@ -27,6 +32,9 @@ namespace Emby.Server.Implementations.Activity _fileSystem = fileSystem; } + /// + /// Initializes the . + /// public void Initialize() { try @@ -45,16 +53,14 @@ namespace Emby.Server.Implementations.Activity private void InitializeInternal() { - using (var connection = GetConnection()) + using var connection = GetConnection(); + connection.RunQueries(new[] { - connection.RunQueries(new[] - { - "create table if not exists ActivityLog (Id INTEGER PRIMARY KEY, Name TEXT NOT NULL, Overview TEXT, ShortOverview TEXT, Type TEXT NOT NULL, ItemId TEXT, UserId TEXT, DateCreated DATETIME NOT NULL, LogSeverity TEXT NOT NULL)", - "drop index if exists idx_ActivityLogEntries" - }); + "create table if not exists ActivityLog (Id INTEGER PRIMARY KEY, Name TEXT NOT NULL, Overview TEXT, ShortOverview TEXT, Type TEXT NOT NULL, ItemId TEXT, UserId TEXT, DateCreated DATETIME NOT NULL, LogSeverity TEXT NOT NULL)", + "drop index if exists idx_ActivityLogEntries" + }); - TryMigrate(connection); - } + TryMigrate(connection); } private void TryMigrate(ManagedConnection connection) @@ -78,6 +84,7 @@ namespace Emby.Server.Implementations.Activity private const string BaseActivitySelectText = "select Id, Name, Overview, ShortOverview, Type, ItemId, UserId, DateCreated, LogSeverity from ActivityLog"; + /// public void Create(ActivityLogEntry entry) { if (entry == null) @@ -85,37 +92,38 @@ namespace Emby.Server.Implementations.Activity throw new ArgumentNullException(nameof(entry)); } - using (var connection = GetConnection()) + using var connection = GetConnection(); + connection.RunInTransaction(db => { - connection.RunInTransaction(db => + using var statement = db.PrepareStatement("insert into ActivityLog (Name, Overview, ShortOverview, Type, ItemId, UserId, DateCreated, LogSeverity) values (@Name, @Overview, @ShortOverview, @Type, @ItemId, @UserId, @DateCreated, @LogSeverity)"); + statement.TryBind("@Name", entry.Name); + + statement.TryBind("@Overview", entry.Overview); + statement.TryBind("@ShortOverview", entry.ShortOverview); + statement.TryBind("@Type", entry.Type); + statement.TryBind("@ItemId", entry.ItemId); + + if (entry.UserId.Equals(Guid.Empty)) { - using (var statement = db.PrepareStatement("insert into ActivityLog (Name, Overview, ShortOverview, Type, ItemId, UserId, DateCreated, LogSeverity) values (@Name, @Overview, @ShortOverview, @Type, @ItemId, @UserId, @DateCreated, @LogSeverity)")) - { - statement.TryBind("@Name", entry.Name); + statement.TryBindNull("@UserId"); + } + else + { + statement.TryBind("@UserId", entry.UserId.ToString("N", CultureInfo.InvariantCulture)); + } - statement.TryBind("@Overview", entry.Overview); - statement.TryBind("@ShortOverview", entry.ShortOverview); - statement.TryBind("@Type", entry.Type); - statement.TryBind("@ItemId", entry.ItemId); + statement.TryBind("@DateCreated", entry.Date.ToDateTimeParamValue()); + statement.TryBind("@LogSeverity", entry.Severity.ToString()); - if (entry.UserId.Equals(Guid.Empty)) - { - statement.TryBindNull("@UserId"); - } - else - { - statement.TryBind("@UserId", entry.UserId.ToString("N", CultureInfo.InvariantCulture)); - } - - statement.TryBind("@DateCreated", entry.Date.ToDateTimeParamValue()); - statement.TryBind("@LogSeverity", entry.Severity.ToString()); - - statement.MoveNext(); - } - }, TransactionMode); - } + statement.MoveNext(); + }, TransactionMode); } + /// + /// Adds the provided to this repository. + /// + /// The activity log entry. + /// If entry is null. public void Update(ActivityLogEntry entry) { if (entry == null) @@ -123,38 +131,35 @@ namespace Emby.Server.Implementations.Activity throw new ArgumentNullException(nameof(entry)); } - using (var connection = GetConnection()) + using var connection = GetConnection(); + connection.RunInTransaction(db => { - connection.RunInTransaction(db => + using var statement = db.PrepareStatement("Update ActivityLog set Name=@Name,Overview=@Overview,ShortOverview=@ShortOverview,Type=@Type,ItemId=@ItemId,UserId=@UserId,DateCreated=@DateCreated,LogSeverity=@LogSeverity where Id=@Id"); + statement.TryBind("@Id", entry.Id); + + statement.TryBind("@Name", entry.Name); + statement.TryBind("@Overview", entry.Overview); + statement.TryBind("@ShortOverview", entry.ShortOverview); + statement.TryBind("@Type", entry.Type); + statement.TryBind("@ItemId", entry.ItemId); + + if (entry.UserId.Equals(Guid.Empty)) { - using (var statement = db.PrepareStatement("Update ActivityLog set Name=@Name,Overview=@Overview,ShortOverview=@ShortOverview,Type=@Type,ItemId=@ItemId,UserId=@UserId,DateCreated=@DateCreated,LogSeverity=@LogSeverity where Id=@Id")) - { - statement.TryBind("@Id", entry.Id); + statement.TryBindNull("@UserId"); + } + else + { + statement.TryBind("@UserId", entry.UserId.ToString("N", CultureInfo.InvariantCulture)); + } - statement.TryBind("@Name", entry.Name); - statement.TryBind("@Overview", entry.Overview); - statement.TryBind("@ShortOverview", entry.ShortOverview); - statement.TryBind("@Type", entry.Type); - statement.TryBind("@ItemId", entry.ItemId); + statement.TryBind("@DateCreated", entry.Date.ToDateTimeParamValue()); + statement.TryBind("@LogSeverity", entry.Severity.ToString()); - if (entry.UserId.Equals(Guid.Empty)) - { - statement.TryBindNull("@UserId"); - } - else - { - statement.TryBind("@UserId", entry.UserId.ToString("N", CultureInfo.InvariantCulture)); - } - - statement.TryBind("@DateCreated", entry.Date.ToDateTimeParamValue()); - statement.TryBind("@LogSeverity", entry.Severity.ToString()); - - statement.MoveNext(); - } - }, TransactionMode); - } + statement.MoveNext(); + }, TransactionMode); } + /// public QueryResult GetActivityLogEntries(DateTime? minDate, bool? hasUserId, int? startIndex, int? limit) { var commandText = BaseActivitySelectText; @@ -164,16 +169,10 @@ namespace Emby.Server.Implementations.Activity { whereClauses.Add("DateCreated>=@DateCreated"); } + if (hasUserId.HasValue) { - if (hasUserId.Value) - { - whereClauses.Add("UserId not null"); - } - else - { - whereClauses.Add("UserId is null"); - } + whereClauses.Add(hasUserId.Value ? "UserId not null" : "UserId is null"); } var whereTextWithoutPaging = whereClauses.Count == 0 ? @@ -216,38 +215,33 @@ namespace Emby.Server.Implementations.Activity var list = new List(); var result = new QueryResult(); - using (var connection = GetConnection(true)) - { - connection.RunInTransaction( - db => + using var connection = GetConnection(true); + connection.RunInTransaction( + db => + { + var statements = PrepareAll(db, statementTexts).ToList(); + + using (var statement = statements[0]) { - var statements = PrepareAll(db, statementTexts).ToList(); - - using (var statement = statements[0]) + if (minDate.HasValue) { - if (minDate.HasValue) - { - statement.TryBind("@DateCreated", minDate.Value.ToDateTimeParamValue()); - } - - foreach (var row in statement.ExecuteQuery()) - { - list.Add(GetEntry(row)); - } + statement.TryBind("@DateCreated", minDate.Value.ToDateTimeParamValue()); } - using (var statement = statements[1]) - { - if (minDate.HasValue) - { - statement.TryBind("@DateCreated", minDate.Value.ToDateTimeParamValue()); - } + list.AddRange(statement.ExecuteQuery().Select(GetEntry)); + } - result.TotalRecordCount = statement.ExecuteQuery().SelectScalarInt().First(); + using (var statement = statements[1]) + { + if (minDate.HasValue) + { + statement.TryBind("@DateCreated", minDate.Value.ToDateTimeParamValue()); } - }, - ReadTransactionMode); - } + + result.TotalRecordCount = statement.ExecuteQuery().SelectScalarInt().First(); + } + }, + ReadTransactionMode); result.Items = list; return result; From 0e8f30f64b9d9f88d2593d97289ed055b7bfbd0d Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 14 Apr 2020 15:08:20 -0400 Subject: [PATCH 058/115] Documented BaseApplicationPath constructor parameters --- Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs b/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs index bc47817438..2adc1d6c34 100644 --- a/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs +++ b/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs @@ -15,6 +15,11 @@ namespace Emby.Server.Implementations.AppBase /// /// Initializes a new instance of the class. /// + /// The program data path. + /// The log directory path. + /// The configuration directory path. + /// The cache directory path. + /// The web directory path. protected BaseApplicationPaths( string programDataPath, string logDirectoryPath, From 9cec01d8ce610fcff99a901d6685668abc96106d Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 14 Apr 2020 15:11:21 -0400 Subject: [PATCH 059/115] Switch to using declaration --- .../AppBase/ConfigurationHelper.cs | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs index 854d7b4cbf..0b681fddfc 100644 --- a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs +++ b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs @@ -36,24 +36,22 @@ namespace Emby.Server.Implementations.AppBase configuration = Activator.CreateInstance(type); } - using (var stream = new MemoryStream()) + using var stream = new MemoryStream(); + xmlSerializer.SerializeToStream(configuration, stream); + + // Take the object we just got and serialize it back to bytes + var newBytes = stream.ToArray(); + + // If the file didn't exist before, or if something has changed, re-save + if (buffer == null || !buffer.SequenceEqual(newBytes)) { - xmlSerializer.SerializeToStream(configuration, stream); + Directory.CreateDirectory(Path.GetDirectoryName(path)); - // Take the object we just got and serialize it back to bytes - var newBytes = stream.ToArray(); - - // If the file didn't exist before, or if something has changed, re-save - if (buffer == null || !buffer.SequenceEqual(newBytes)) - { - Directory.CreateDirectory(Path.GetDirectoryName(path)); - - // Save it after load in case we got new items - File.WriteAllBytes(path, newBytes); - } - - return configuration; + // Save it after load in case we got new items + File.WriteAllBytes(path, newBytes); } + + return configuration; } } } From 90e256416942d14a4c765cfcb48e7c740fb2361c Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 14 Apr 2020 15:16:04 -0400 Subject: [PATCH 060/115] Document and clean up ZipClient.cs --- .../Archiving/ZipClient.cs | 130 +++++++----------- 1 file changed, 53 insertions(+), 77 deletions(-) diff --git a/Emby.Server.Implementations/Archiving/ZipClient.cs b/Emby.Server.Implementations/Archiving/ZipClient.cs index 4a6e5cfd75..591ae547d6 100644 --- a/Emby.Server.Implementations/Archiving/ZipClient.cs +++ b/Emby.Server.Implementations/Archiving/ZipClient.cs @@ -22,10 +22,8 @@ namespace Emby.Server.Implementations.Archiving /// if set to true [overwrite existing files]. public void ExtractAll(string sourceFile, string targetPath, bool overwriteExistingFiles) { - using (var fileStream = File.OpenRead(sourceFile)) - { - ExtractAll(fileStream, targetPath, overwriteExistingFiles); - } + using var fileStream = File.OpenRead(sourceFile); + ExtractAll(fileStream, targetPath, overwriteExistingFiles); } /// @@ -36,67 +34,61 @@ namespace Emby.Server.Implementations.Archiving /// if set to true [overwrite existing files]. public void ExtractAll(Stream source, string targetPath, bool overwriteExistingFiles) { - using (var reader = ReaderFactory.Open(source)) + using var reader = ReaderFactory.Open(source); + var options = new ExtractionOptions { - var options = new ExtractionOptions(); - options.ExtractFullPath = true; + ExtractFullPath = true + }; - if (overwriteExistingFiles) - { - options.Overwrite = true; - } - - reader.WriteAllToDirectory(targetPath, options); + if (overwriteExistingFiles) + { + options.Overwrite = true; } + + reader.WriteAllToDirectory(targetPath, options); } + /// public void ExtractAllFromZip(Stream source, string targetPath, bool overwriteExistingFiles) { - using (var reader = ZipReader.Open(source)) + using var reader = ZipReader.Open(source); + var options = new ExtractionOptions { - var options = new ExtractionOptions(); - options.ExtractFullPath = true; + ExtractFullPath = true, + Overwrite = overwriteExistingFiles + }; - if (overwriteExistingFiles) - { - options.Overwrite = true; - } - - reader.WriteAllToDirectory(targetPath, options); - } + reader.WriteAllToDirectory(targetPath, options); } + /// public void ExtractAllFromGz(Stream source, string targetPath, bool overwriteExistingFiles) { - using (var reader = GZipReader.Open(source)) + using var reader = GZipReader.Open(source); + var options = new ExtractionOptions { - var options = new ExtractionOptions(); - options.ExtractFullPath = true; + ExtractFullPath = true, + Overwrite = overwriteExistingFiles + }; - if (overwriteExistingFiles) - { - options.Overwrite = true; - } - - reader.WriteAllToDirectory(targetPath, options); - } + reader.WriteAllToDirectory(targetPath, options); } + /// public void ExtractFirstFileFromGz(Stream source, string targetPath, string defaultFileName) { - using (var reader = GZipReader.Open(source)) + using var reader = GZipReader.Open(source); + if (reader.MoveToNextEntry()) { - if (reader.MoveToNextEntry()) - { - var entry = reader.Entry; + var entry = reader.Entry; - var filename = entry.Key; - if (string.IsNullOrWhiteSpace(filename)) - { - filename = defaultFileName; - } - reader.WriteEntryToFile(Path.Combine(targetPath, filename)); + var filename = entry.Key; + if (string.IsNullOrWhiteSpace(filename)) + { + filename = defaultFileName; } + + reader.WriteEntryToFile(Path.Combine(targetPath, filename)); } } @@ -108,10 +100,8 @@ namespace Emby.Server.Implementations.Archiving /// if set to true [overwrite existing files]. public void ExtractAllFrom7z(string sourceFile, string targetPath, bool overwriteExistingFiles) { - using (var fileStream = File.OpenRead(sourceFile)) - { - ExtractAllFrom7z(fileStream, targetPath, overwriteExistingFiles); - } + using var fileStream = File.OpenRead(sourceFile); + ExtractAllFrom7z(fileStream, targetPath, overwriteExistingFiles); } /// @@ -122,21 +112,15 @@ namespace Emby.Server.Implementations.Archiving /// if set to true [overwrite existing files]. public void ExtractAllFrom7z(Stream source, string targetPath, bool overwriteExistingFiles) { - using (var archive = SevenZipArchive.Open(source)) + using var archive = SevenZipArchive.Open(source); + using var reader = archive.ExtractAllEntries(); + var options = new ExtractionOptions { - using (var reader = archive.ExtractAllEntries()) - { - var options = new ExtractionOptions(); - options.ExtractFullPath = true; + ExtractFullPath = true, + Overwrite = overwriteExistingFiles + }; - if (overwriteExistingFiles) - { - options.Overwrite = true; - } - - reader.WriteAllToDirectory(targetPath, options); - } - } + reader.WriteAllToDirectory(targetPath, options); } /// @@ -147,10 +131,8 @@ namespace Emby.Server.Implementations.Archiving /// if set to true [overwrite existing files]. public void ExtractAllFromTar(string sourceFile, string targetPath, bool overwriteExistingFiles) { - using (var fileStream = File.OpenRead(sourceFile)) - { - ExtractAllFromTar(fileStream, targetPath, overwriteExistingFiles); - } + using var fileStream = File.OpenRead(sourceFile); + ExtractAllFromTar(fileStream, targetPath, overwriteExistingFiles); } /// @@ -161,21 +143,15 @@ namespace Emby.Server.Implementations.Archiving /// if set to true [overwrite existing files]. public void ExtractAllFromTar(Stream source, string targetPath, bool overwriteExistingFiles) { - using (var archive = TarArchive.Open(source)) + using var archive = TarArchive.Open(source); + using var reader = archive.ExtractAllEntries(); + var options = new ExtractionOptions { - using (var reader = archive.ExtractAllEntries()) - { - var options = new ExtractionOptions(); - options.ExtractFullPath = true; + ExtractFullPath = true, + Overwrite = overwriteExistingFiles + }; - if (overwriteExistingFiles) - { - options.Overwrite = true; - } - - reader.WriteAllToDirectory(targetPath, options); - } - } + reader.WriteAllToDirectory(targetPath, options); } } } From 4c0547f90c0fa1cd8a931de630899e68933e21c7 Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 14 Apr 2020 15:19:11 -0400 Subject: [PATCH 061/115] Document BrandingConfigurationFactory.cs --- .../Branding/BrandingConfigurationFactory.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Emby.Server.Implementations/Branding/BrandingConfigurationFactory.cs b/Emby.Server.Implementations/Branding/BrandingConfigurationFactory.cs index 93000ae127..43c8cd5fa2 100644 --- a/Emby.Server.Implementations/Branding/BrandingConfigurationFactory.cs +++ b/Emby.Server.Implementations/Branding/BrandingConfigurationFactory.cs @@ -1,13 +1,15 @@ -#pragma warning disable CS1591 - using System.Collections.Generic; using MediaBrowser.Common.Configuration; using MediaBrowser.Model.Branding; namespace Emby.Server.Implementations.Branding { + /// + /// Branding configuration factory. + /// public class BrandingConfigurationFactory : IConfigurationFactory { + /// public IEnumerable GetConfigurations() { return new[] From 543c76a8f10f7d55b4e0d2c0ed848f40d35debda Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 14 Apr 2020 15:28:02 -0400 Subject: [PATCH 062/115] Clean up and document ChannelDynamicMediaSourceProvider.cs --- .../Channels/ChannelDynamicMediaSourceProvider.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs b/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs index 6016fed079..c677e9fbc3 100644 --- a/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs +++ b/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs @@ -1,5 +1,3 @@ -#pragma warning disable CS1591 - using System; using System.Collections.Generic; using System.Threading; @@ -11,6 +9,9 @@ using MediaBrowser.Model.Dto; namespace Emby.Server.Implementations.Channels { + /// + /// A media source provider for channels. + /// public class ChannelDynamicMediaSourceProvider : IMediaSourceProvider { private readonly ChannelManager _channelManager; @@ -27,12 +28,9 @@ namespace Emby.Server.Implementations.Channels /// public Task> GetMediaSources(BaseItem item, CancellationToken cancellationToken) { - if (item.SourceType == SourceType.Channel) - { - return _channelManager.GetDynamicMediaSources(item, cancellationToken); - } - - return Task.FromResult>(new List()); + return item.SourceType == SourceType.Channel + ? _channelManager.GetDynamicMediaSources(item, cancellationToken) + : Task.FromResult>(new List()); } /// From 2c920cff33f8e765b79e805d96f3bc547bc7b3fc Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 14 Apr 2020 15:29:57 -0400 Subject: [PATCH 063/115] Document ChannelImageProvider.cs --- .../Channels/ChannelImageProvider.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Emby.Server.Implementations/Channels/ChannelImageProvider.cs b/Emby.Server.Implementations/Channels/ChannelImageProvider.cs index 62aeb9bcb9..c08a237fb4 100644 --- a/Emby.Server.Implementations/Channels/ChannelImageProvider.cs +++ b/Emby.Server.Implementations/Channels/ChannelImageProvider.cs @@ -1,5 +1,3 @@ -#pragma warning disable CS1591 - using System.Collections.Generic; using System.Linq; using System.Threading; @@ -11,20 +9,29 @@ using MediaBrowser.Model.Entities; namespace Emby.Server.Implementations.Channels { + /// + /// An image provider for channels. + /// public class ChannelImageProvider : IDynamicImageProvider, IHasItemChangeMonitor { private readonly IChannelManager _channelManager; + /// + /// Initializes a new instance of the class. + /// + /// The channel manager. public ChannelImageProvider(IChannelManager channelManager) { _channelManager = channelManager; } + /// public IEnumerable GetSupportedImages(BaseItem item) { return GetChannel(item).GetSupportedChannelImages(); } + /// public Task GetImage(BaseItem item, ImageType type, CancellationToken cancellationToken) { var channel = GetChannel(item); @@ -32,8 +39,10 @@ namespace Emby.Server.Implementations.Channels return channel.GetChannelImage(type, cancellationToken); } + /// public string Name => "Channel Image Provider"; + /// public bool Supports(BaseItem item) { return item is Channel; @@ -46,6 +55,7 @@ namespace Emby.Server.Implementations.Channels return ((ChannelManager)_channelManager).GetChannelProvider(channel); } + /// public bool HasChanged(BaseItem item, IDirectoryService directoryService) { return GetSupportedImages(item).Any(i => !item.HasImage(i)); From c8e26b6d46f98ab04041064a0e7db2e731360db8 Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 14 Apr 2020 15:36:29 -0400 Subject: [PATCH 064/115] Document ChannelPostScanTask.cs --- .../Channels/ChannelPostScanTask.cs | 22 ++++++++++++++----- .../Channels/RefreshChannelsScheduledTask.cs | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Emby.Server.Implementations/Channels/ChannelPostScanTask.cs b/Emby.Server.Implementations/Channels/ChannelPostScanTask.cs index 266d539d0a..f48b0a7faa 100644 --- a/Emby.Server.Implementations/Channels/ChannelPostScanTask.cs +++ b/Emby.Server.Implementations/Channels/ChannelPostScanTask.cs @@ -1,5 +1,3 @@ -#pragma warning disable CS1591 - using System; using System.Linq; using System.Threading; @@ -11,21 +9,35 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Channels { + /// + /// Channel post scan task. + /// This task removes all non-installed channels from the database. + /// public class ChannelPostScanTask { private readonly IChannelManager _channelManager; - private readonly IUserManager _userManager; private readonly ILogger _logger; private readonly ILibraryManager _libraryManager; - public ChannelPostScanTask(IChannelManager channelManager, IUserManager userManager, ILogger logger, ILibraryManager libraryManager) + /// + /// Initializes a new instance of the class. + /// + /// The channel manager. + /// The logger. + /// The library manager. + public ChannelPostScanTask(IChannelManager channelManager, ILogger logger, ILibraryManager libraryManager) { _channelManager = channelManager; - _userManager = userManager; _logger = logger; _libraryManager = libraryManager; } + /// + /// Runs this task. + /// + /// The progress. + /// The cancellation token. + /// The completed task. public Task Run(IProgress progress, CancellationToken cancellationToken) { CleanDatabase(cancellationToken); diff --git a/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs b/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs index 367efcb134..36cec75ec8 100644 --- a/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs +++ b/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs @@ -63,7 +63,7 @@ namespace Emby.Server.Implementations.Channels await manager.RefreshChannels(new SimpleProgress(), cancellationToken).ConfigureAwait(false); - await new ChannelPostScanTask(_channelManager, _userManager, _logger, _libraryManager).Run(progress, cancellationToken) + await new ChannelPostScanTask(_channelManager, _logger, _libraryManager).Run(progress, cancellationToken) .ConfigureAwait(false); } From f29e6badb3d6350fc828ac58dc645dc7b166c376 Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 14 Apr 2020 15:48:06 -0400 Subject: [PATCH 065/115] Remove unused field and documented RefreshChannelsScheduledTask.cs --- .../Channels/RefreshChannelsScheduledTask.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs b/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs index 36cec75ec8..54b621e250 100644 --- a/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs +++ b/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs @@ -1,5 +1,3 @@ -#pragma warning disable CS1591 - using System; using System.Collections.Generic; using System.Threading; @@ -7,29 +5,36 @@ using System.Threading.Tasks; using MediaBrowser.Common.Progress; using MediaBrowser.Controller.Channels; using MediaBrowser.Controller.Library; +using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Tasks; using Microsoft.Extensions.Logging; -using MediaBrowser.Model.Globalization; namespace Emby.Server.Implementations.Channels { + /// + /// The "Refresh Channels" scheduled task. + /// public class RefreshChannelsScheduledTask : IScheduledTask, IConfigurableScheduledTask { private readonly IChannelManager _channelManager; - private readonly IUserManager _userManager; private readonly ILogger _logger; private readonly ILibraryManager _libraryManager; private readonly ILocalizationManager _localization; + /// + /// Initializes a new instance of the class. + /// + /// The channel manager. + /// The logger. + /// The library manager. + /// The localization manager. public RefreshChannelsScheduledTask( IChannelManager channelManager, - IUserManager userManager, ILogger logger, ILibraryManager libraryManager, ILocalizationManager localization) { _channelManager = channelManager; - _userManager = userManager; _logger = logger; _libraryManager = libraryManager; _localization = localization; @@ -72,7 +77,6 @@ namespace Emby.Server.Implementations.Channels { return new[] { - // Every so often new TaskTriggerInfo { From 77df0c943b342b4b8642809fc6dbfbd6e0e8d5a7 Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 14 Apr 2020 15:50:48 -0400 Subject: [PATCH 066/115] Clean up and document CollectionImageProvider.cs --- .../Collections/CollectionImageProvider.cs | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Emby.Server.Implementations/Collections/CollectionImageProvider.cs b/Emby.Server.Implementations/Collections/CollectionImageProvider.cs index 21ba0288ec..4d9f865e06 100644 --- a/Emby.Server.Implementations/Collections/CollectionImageProvider.cs +++ b/Emby.Server.Implementations/Collections/CollectionImageProvider.cs @@ -1,5 +1,3 @@ -#pragma warning disable CS1591 - using System.Collections.Generic; using System.Linq; using Emby.Server.Implementations.Images; @@ -15,8 +13,18 @@ using MediaBrowser.Model.IO; namespace Emby.Server.Implementations.Collections { + /// + /// A collection image provider. + /// public class CollectionImageProvider : BaseDynamicImageProvider { + /// + /// Initializes a new instance of the class. + /// + /// The filesystem. + /// The provider manager. + /// The application paths. + /// The image processor. public CollectionImageProvider( IFileSystem fileSystem, IProviderManager providerManager, @@ -48,13 +56,10 @@ namespace Emby.Server.Implementations.Collections var episode = subItem as Episode; - if (episode != null) + var series = episode?.Series; + if (series != null && series.HasImage(ImageType.Primary)) { - var series = episode.Series; - if (series != null && series.HasImage(ImageType.Primary)) - { - return series; - } + return series; } if (subItem.HasImage(ImageType.Primary)) From ddd8120aabc0754660e3f282408523932b61dd77 Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 14 Apr 2020 15:57:05 -0400 Subject: [PATCH 067/115] Clean up and document CollectionManager.cs --- .../Collections/CollectionManager.cs | 37 ++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.cs index 3219528749..297e8327a5 100644 --- a/Emby.Server.Implementations/Collections/CollectionManager.cs +++ b/Emby.Server.Implementations/Collections/CollectionManager.cs @@ -1,5 +1,3 @@ -#pragma warning disable CS1591 - using System; using System.Collections.Generic; using System.Globalization; @@ -23,6 +21,7 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Collections { + /// public class CollectionManager : ICollectionManager { private readonly ILibraryManager _libraryManager; @@ -33,6 +32,16 @@ namespace Emby.Server.Implementations.Collections private readonly ILocalizationManager _localizationManager; private readonly IApplicationPaths _appPaths; + /// + /// Initializes a new instance of the class. + /// + /// The library manager. + /// The application paths. + /// The localization manager. + /// The filesystem. + /// The library monitor. + /// The logger factory. + /// The provider manager. public CollectionManager( ILibraryManager libraryManager, IApplicationPaths appPaths, @@ -51,8 +60,13 @@ namespace Emby.Server.Implementations.Collections _appPaths = appPaths; } + /// public event EventHandler CollectionCreated; + + /// public event EventHandler ItemsAddedToCollection; + + /// public event EventHandler ItemsRemovedFromCollection; private IEnumerable FindFolders(string path) @@ -114,6 +128,7 @@ namespace Emby.Server.Implementations.Collections folder.GetChildren(user, true).OfType(); } + /// public BoxSet CreateCollection(CollectionCreationOptions options) { var name = options.Name; @@ -178,11 +193,13 @@ namespace Emby.Server.Implementations.Collections } } + /// public void AddToCollection(Guid collectionId, IEnumerable ids) { AddToCollection(collectionId, ids, true, new MetadataRefreshOptions(new DirectoryService(_fileSystem))); } + /// public void AddToCollection(Guid collectionId, IEnumerable ids) { AddToCollection(collectionId, ids.Select(i => i.ToString("N", CultureInfo.InvariantCulture)), true, new MetadataRefreshOptions(new DirectoryService(_fileSystem))); @@ -246,11 +263,13 @@ namespace Emby.Server.Implementations.Collections } } + /// public void RemoveFromCollection(Guid collectionId, IEnumerable itemIds) { RemoveFromCollection(collectionId, itemIds.Select(i => new Guid(i))); } + /// public void RemoveFromCollection(Guid collectionId, IEnumerable itemIds) { var collection = _libraryManager.GetItemById(collectionId) as BoxSet; @@ -301,6 +320,7 @@ namespace Emby.Server.Implementations.Collections }); } + /// public IEnumerable CollapseItemsWithinBoxSets(IEnumerable items, User user) { var results = new Dictionary(); @@ -309,9 +329,7 @@ namespace Emby.Server.Implementations.Collections foreach (var item in items) { - var grouping = item as ISupportsBoxSetGrouping; - - if (grouping == null) + if (!(item is ISupportsBoxSetGrouping)) { results[item.Id] = item; } @@ -341,12 +359,21 @@ namespace Emby.Server.Implementations.Collections } } + /// + /// The collection manager entry point. + /// public sealed class CollectionManagerEntryPoint : IServerEntryPoint { private readonly CollectionManager _collectionManager; private readonly IServerConfigurationManager _config; private readonly ILogger _logger; + /// + /// Initializes a new instance of the class. + /// + /// The collection manager. + /// The server configuration manager. + /// The logger. public CollectionManagerEntryPoint( ICollectionManager collectionManager, IServerConfigurationManager config, From ecaae2c8de3bf03d3a74de865546dc6b14c06b12 Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 14 Apr 2020 16:01:21 -0400 Subject: [PATCH 068/115] Clean up and document ServerConfigurationManager.cs --- .../Configuration/ServerConfigurationManager.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs index f407317ec7..0ff70decae 100644 --- a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs +++ b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs @@ -69,21 +69,16 @@ namespace Emby.Server.Implementations.Configuration /// private void UpdateMetadataPath() { - if (string.IsNullOrWhiteSpace(Configuration.MetadataPath)) - { - ((ServerApplicationPaths)ApplicationPaths).InternalMetadataPath = Path.Combine(ApplicationPaths.ProgramDataPath, "metadata"); - } - else - { - ((ServerApplicationPaths)ApplicationPaths).InternalMetadataPath = Configuration.MetadataPath; - } + ((ServerApplicationPaths)ApplicationPaths).InternalMetadataPath = string.IsNullOrWhiteSpace(Configuration.MetadataPath) + ? Path.Combine(ApplicationPaths.ProgramDataPath, "metadata") + : Configuration.MetadataPath; } /// /// Replaces the configuration. /// /// The new configuration. - /// + /// If the configuration path doesn't exist. public override void ReplaceConfiguration(BaseApplicationConfiguration newConfiguration) { var newConfig = (ServerConfiguration)newConfiguration; From fd750a9c79a8bb39ecfab053315f39ea54d0f53b Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 14 Apr 2020 16:13:41 -0400 Subject: [PATCH 069/115] Clean up and document CryptographyProvider.cs --- .../Cryptography/CryptographyProvider.cs | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs b/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs index de83b023d7..a037415a95 100644 --- a/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs +++ b/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs @@ -31,7 +31,7 @@ namespace Emby.Server.Implementations.Cryptography private RandomNumberGenerator _randomNumberGenerator; - private bool _disposed = false; + private bool _disposed; /// /// Initializes a new instance of the class. @@ -56,15 +56,13 @@ namespace Emby.Server.Implementations.Cryptography { // downgrading for now as we need this library to be dotnetstandard compliant // with this downgrade we'll add a check to make sure we're on the downgrade method at the moment - if (method == DefaultHashMethod) + if (method != DefaultHashMethod) { - using (var r = new Rfc2898DeriveBytes(bytes, salt, iterations)) - { - return r.GetBytes(32); - } + throw new CryptographicException($"Cannot currently use PBKDF2 with requested hash method: {method}"); } - throw new CryptographicException($"Cannot currently use PBKDF2 with requested hash method: {method}"); + using var r = new Rfc2898DeriveBytes(bytes, salt, iterations); + return r.GetBytes(32); } /// @@ -74,25 +72,22 @@ namespace Emby.Server.Implementations.Cryptography { return PBKDF2(hashMethod, bytes, salt, DefaultIterations); } - else if (_supportedHashMethods.Contains(hashMethod)) + + if (!_supportedHashMethods.Contains(hashMethod)) { - using (var h = HashAlgorithm.Create(hashMethod)) - { - if (salt.Length == 0) - { - return h.ComputeHash(bytes); - } - else - { - byte[] salted = new byte[bytes.Length + salt.Length]; - Array.Copy(bytes, salted, bytes.Length); - Array.Copy(salt, 0, salted, bytes.Length, salt.Length); - return h.ComputeHash(salted); - } - } + throw new CryptographicException($"Requested hash method is not supported: {hashMethod}"); } - throw new CryptographicException($"Requested hash method is not supported: {hashMethod}"); + using var h = HashAlgorithm.Create(hashMethod); + if (salt.Length == 0) + { + return h.ComputeHash(bytes); + } + + byte[] salted = new byte[bytes.Length + salt.Length]; + Array.Copy(bytes, salted, bytes.Length); + Array.Copy(salt, 0, salted, bytes.Length, salt.Length); + return h.ComputeHash(salted); } /// From a54dca09d8c581bc2f64235d2d9a07278f5c02c4 Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 14 Apr 2020 19:34:38 -0400 Subject: [PATCH 070/115] Added the last missing documentation --- .../Collections/CollectionImageProvider.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Emby.Server.Implementations/Collections/CollectionImageProvider.cs b/Emby.Server.Implementations/Collections/CollectionImageProvider.cs index 4d9f865e06..c69a07e83e 100644 --- a/Emby.Server.Implementations/Collections/CollectionImageProvider.cs +++ b/Emby.Server.Implementations/Collections/CollectionImageProvider.cs @@ -34,6 +34,7 @@ namespace Emby.Server.Implementations.Collections { } + /// protected override bool Supports(BaseItem item) { // Right now this is the only way to prevent this image from getting created ahead of internet image providers @@ -45,6 +46,7 @@ namespace Emby.Server.Implementations.Collections return base.Supports(item); } + /// protected override IReadOnlyList GetItemsWithImages(BaseItem item) { var playlist = (BoxSet)item; @@ -85,6 +87,7 @@ namespace Emby.Server.Implementations.Collections .ToList(); } + /// protected override string CreateImage(BaseItem item, IReadOnlyCollection itemsWithImages, string outputPathWithoutExtension, ImageType imageType, int imageIndex) { return CreateSingleImage(itemsWithImages, outputPathWithoutExtension, ImageType.Primary); From c4e6329e58f36c340a65fa216a058ce1fee5507f Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Wed, 15 Apr 2020 15:00:45 -0400 Subject: [PATCH 071/115] Clean up and document ChannelManager.cs and implement suggestions --- .../Activity/ActivityLogEntryPoint.cs | 1 - .../Activity/ActivityManager.cs | 4 +- .../Activity/ActivityRepository.cs | 4 +- .../ChannelDynamicMediaSourceProvider.cs | 3 +- .../Channels/ChannelManager.cs | 225 ++++++++++-------- .../Collections/CollectionManager.cs | 4 +- 6 files changed, 139 insertions(+), 102 deletions(-) diff --git a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs index e025417d13..2ea6789765 100644 --- a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs +++ b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs @@ -27,7 +27,6 @@ namespace Emby.Server.Implementations.Activity { /// /// The activity log entry point. - /// . /// public sealed class ActivityLogEntryPoint : IServerEntryPoint { diff --git a/Emby.Server.Implementations/Activity/ActivityManager.cs b/Emby.Server.Implementations/Activity/ActivityManager.cs index 2d2dc8e61e..5c04c0e51a 100644 --- a/Emby.Server.Implementations/Activity/ActivityManager.cs +++ b/Emby.Server.Implementations/Activity/ActivityManager.cs @@ -6,7 +6,9 @@ using MediaBrowser.Model.Querying; namespace Emby.Server.Implementations.Activity { - /// + /// + /// The activity log manager. + /// public class ActivityManager : IActivityManager { /// diff --git a/Emby.Server.Implementations/Activity/ActivityRepository.cs b/Emby.Server.Implementations/Activity/ActivityRepository.cs index 697ad7fcc0..3aa1f03976 100644 --- a/Emby.Server.Implementations/Activity/ActivityRepository.cs +++ b/Emby.Server.Implementations/Activity/ActivityRepository.cs @@ -13,7 +13,9 @@ using SQLitePCL.pretty; namespace Emby.Server.Implementations.Activity { - /// + /// + /// The activity log repository. + /// public class ActivityRepository : BaseSqliteRepository, IActivityRepository { private static readonly CultureInfo _usCulture = CultureInfo.ReadOnly(new CultureInfo("en-US")); diff --git a/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs b/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs index c677e9fbc3..3e149cc82c 100644 --- a/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs +++ b/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Channels; @@ -30,7 +31,7 @@ namespace Emby.Server.Implementations.Channels { return item.SourceType == SourceType.Channel ? _channelManager.GetDynamicMediaSources(item, cancellationToken) - : Task.FromResult>(new List()); + : Task.FromResult(Enumerable.Empty()); } /// diff --git a/Emby.Server.Implementations/Channels/ChannelManager.cs b/Emby.Server.Implementations/Channels/ChannelManager.cs index 6e1baddfed..8beb5866f1 100644 --- a/Emby.Server.Implementations/Channels/ChannelManager.cs +++ b/Emby.Server.Implementations/Channels/ChannelManager.cs @@ -1,5 +1,3 @@ -#pragma warning disable CS1591 - using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -29,6 +27,9 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Channels { + /// + /// The LiveTV channel manager. + /// public class ChannelManager : IChannelManager { internal IChannel[] Channels { get; private set; } @@ -43,6 +44,18 @@ namespace Emby.Server.Implementations.Channels private readonly IJsonSerializer _jsonSerializer; private readonly IProviderManager _providerManager; + /// + /// Initializes a new instance of the class. + /// + /// The user manager. + /// The dto service. + /// The library manager. + /// The logger factory. + /// The server configuration manager. + /// The filesystem. + /// The user data manager. + /// The JSON serializer. + /// The provider manager. public ChannelManager( IUserManager userManager, IDtoService dtoService, @@ -67,11 +80,13 @@ namespace Emby.Server.Implementations.Channels private static TimeSpan CacheLength => TimeSpan.FromHours(3); + /// public void AddParts(IEnumerable channels) { Channels = channels.ToArray(); } + /// public bool EnableMediaSourceDisplay(BaseItem item) { var internalChannel = _libraryManager.GetItemById(item.ChannelId); @@ -80,15 +95,16 @@ namespace Emby.Server.Implementations.Channels return !(channel is IDisableMediaSourceDisplay); } + /// public bool CanDelete(BaseItem item) { var internalChannel = _libraryManager.GetItemById(item.ChannelId); var channel = Channels.FirstOrDefault(i => GetInternalChannelId(i.Name).Equals(internalChannel.Id)); - var supportsDelete = channel as ISupportsDelete; - return supportsDelete != null && supportsDelete.CanDelete(item); + return channel is ISupportsDelete supportsDelete && supportsDelete.CanDelete(item); } + /// public bool EnableMediaProbe(BaseItem item) { var internalChannel = _libraryManager.GetItemById(item.ChannelId); @@ -97,6 +113,7 @@ namespace Emby.Server.Implementations.Channels return channel is ISupportsMediaProbe; } + /// public Task DeleteItem(BaseItem item) { var internalChannel = _libraryManager.GetItemById(item.ChannelId); @@ -123,11 +140,16 @@ namespace Emby.Server.Implementations.Channels .OrderBy(i => i.Name); } + /// + /// Returns an containing installed channel ID's. + /// + /// An containing installed channel ID's. public IEnumerable GetInstalledChannelIds() { return GetAllChannels().Select(i => GetInternalChannelId(i.Name)); } + /// public QueryResult GetChannelsInternal(ChannelQuery query) { var user = query.UserId.Equals(Guid.Empty) @@ -146,15 +168,13 @@ namespace Emby.Server.Implementations.Channels { try { - var hasAttributes = GetChannelProvider(i) as IHasFolderAttributes; - - return (hasAttributes != null && hasAttributes.Attributes.Contains("Recordings", StringComparer.OrdinalIgnoreCase)) == val; + return (GetChannelProvider(i) is IHasFolderAttributes hasAttributes + && hasAttributes.Attributes.Contains("Recordings", StringComparer.OrdinalIgnoreCase)) == val; } catch { return false; } - }).ToList(); } @@ -171,7 +191,6 @@ namespace Emby.Server.Implementations.Channels { return false; } - }).ToList(); } @@ -188,9 +207,9 @@ namespace Emby.Server.Implementations.Channels { return false; } - }).ToList(); } + if (query.IsFavorite.HasValue) { var val = query.IsFavorite.Value; @@ -215,7 +234,6 @@ namespace Emby.Server.Implementations.Channels { return false; } - }).ToList(); } @@ -226,6 +244,7 @@ namespace Emby.Server.Implementations.Channels { all = all.Skip(query.StartIndex.Value).ToList(); } + if (query.Limit.HasValue) { all = all.Take(query.Limit.Value).ToList(); @@ -248,6 +267,7 @@ namespace Emby.Server.Implementations.Channels }; } + /// public QueryResult GetChannels(ChannelQuery query) { var user = query.UserId.Equals(Guid.Empty) @@ -272,6 +292,12 @@ namespace Emby.Server.Implementations.Channels return result; } + /// + /// Refreshes the associated channels. + /// + /// The progress. + /// The cancellation token. + /// The completed task. public async Task RefreshChannels(IProgress progress, CancellationToken cancellationToken) { var allChannelsList = GetAllChannels().ToList(); @@ -305,14 +331,7 @@ namespace Emby.Server.Implementations.Channels private Channel GetChannelEntity(IChannel channel) { - var item = GetChannel(GetInternalChannelId(channel.Name)); - - if (item == null) - { - item = GetChannel(channel, CancellationToken.None).Result; - } - - return item; + return GetChannel(GetInternalChannelId(channel.Name)) ?? GetChannel(channel, CancellationToken.None).Result; } private List GetSavedMediaSources(BaseItem item) @@ -351,6 +370,7 @@ namespace Emby.Server.Implementations.Channels _jsonSerializer.SerializeToFile(mediaSources, path); } + /// public IEnumerable GetStaticMediaSources(BaseItem item, CancellationToken cancellationToken) { IEnumerable results = GetSavedMediaSources(item); @@ -360,6 +380,12 @@ namespace Emby.Server.Implementations.Channels .ToList(); } + /// + /// Gets the dynamic media sources based on the provided item. + /// + /// The item. + /// The cancellation token. + /// The completed task. public async Task> GetDynamicMediaSources(BaseItem item, CancellationToken cancellationToken) { var channel = GetChannel(item.ChannelId); @@ -409,7 +435,7 @@ namespace Emby.Server.Implementations.Channels private static MediaSourceInfo NormalizeMediaSource(BaseItem item, MediaSourceInfo info) { - info.RunTimeTicks = info.RunTimeTicks ?? item.RunTimeTicks; + info.RunTimeTicks ??= item.RunTimeTicks; return info; } @@ -482,41 +508,43 @@ namespace Emby.Server.Implementations.Channels private static string GetOfficialRating(ChannelParentalRating rating) { - switch (rating) + return rating switch { - case ChannelParentalRating.Adult: - return "XXX"; - case ChannelParentalRating.UsR: - return "R"; - case ChannelParentalRating.UsPG13: - return "PG-13"; - case ChannelParentalRating.UsPG: - return "PG"; - default: - return null; - } + ChannelParentalRating.Adult => "XXX", + ChannelParentalRating.UsR => "R", + ChannelParentalRating.UsPG13 => "PG-13", + ChannelParentalRating.UsPG => "PG", + _ => null + }; } + /// + /// Gets a channel with the provided Guid. + /// + /// The Guid. + /// The corresponding channel. public Channel GetChannel(Guid id) { return _libraryManager.GetItemById(id) as Channel; } + /// public Channel GetChannel(string id) { return _libraryManager.GetItemById(id) as Channel; } + /// public ChannelFeatures[] GetAllChannelFeatures() { return _libraryManager.GetItemIds(new InternalItemsQuery { IncludeItemTypes = new[] { typeof(Channel).Name }, OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) } - }).Select(i => GetChannelFeatures(i.ToString("N", CultureInfo.InvariantCulture))).ToArray(); } + /// public ChannelFeatures GetChannelFeatures(string id) { if (string.IsNullOrEmpty(id)) @@ -530,6 +558,11 @@ namespace Emby.Server.Implementations.Channels return GetChannelFeaturesDto(channel, channelProvider, channelProvider.GetChannelFeatures()); } + /// + /// Checks whether the provided Guid supports external transfer. + /// + /// The Guid. + /// Whether or not the provided Guid supports external transfer. public bool SupportsExternalTransfer(Guid channelId) { //var channel = GetChannel(channelId); @@ -538,6 +571,13 @@ namespace Emby.Server.Implementations.Channels return channelProvider.GetChannelFeatures().SupportsContentDownloading; } + /// + /// Gets the provided channel's supported features. + /// + /// The channel. + /// The provider. + /// The features. + /// The supported features. public ChannelFeatures GetChannelFeaturesDto(Channel channel, IChannel provider, InternalChannelFeatures features) @@ -570,6 +610,7 @@ namespace Emby.Server.Implementations.Channels return _libraryManager.GetNewItemId("Channel " + name, typeof(Channel)); } + /// public async Task> GetLatestChannelItems(InternalItemsQuery query, CancellationToken cancellationToken) { var internalResult = await GetLatestChannelItemsInternal(query, cancellationToken).ConfigureAwait(false); @@ -588,6 +629,7 @@ namespace Emby.Server.Implementations.Channels return result; } + /// public async Task> GetLatestChannelItemsInternal(InternalItemsQuery query, CancellationToken cancellationToken) { var channels = GetAllChannels().Where(i => i is ISupportsLatestMedia).ToArray(); @@ -662,6 +704,7 @@ namespace Emby.Server.Implementations.Channels } } + /// public async Task> GetChannelItemsInternal(InternalItemsQuery query, IProgress progress, CancellationToken cancellationToken) { // Get the internal channel entity @@ -711,7 +754,6 @@ namespace Emby.Server.Implementations.Channels { DeleteFileLocation = false, DeleteFromExternalProvider = false - }, parentItem, false); } } @@ -720,6 +762,7 @@ namespace Emby.Server.Implementations.Channels return _libraryManager.GetItemsResult(query); } + /// public async Task> GetChannelItems(InternalItemsQuery query, CancellationToken cancellationToken) { var internalResult = await GetChannelItemsInternal(query, new SimpleProgress(), cancellationToken).ConfigureAwait(false); @@ -743,7 +786,7 @@ namespace Emby.Server.Implementations.Channels bool sortDescending, CancellationToken cancellationToken) { - var userId = user == null ? null : user.Id.ToString("N", CultureInfo.InvariantCulture); + var userId = user?.Id.ToString("N", CultureInfo.InvariantCulture); var cacheLength = CacheLength; var cachePath = GetChannelDataCachePath(channel, userId, externalFolderId, sortField, sortDescending); @@ -794,7 +837,7 @@ namespace Emby.Server.Implementations.Channels var query = new InternalChannelItemQuery { - UserId = user == null ? Guid.Empty : user.Id, + UserId = user?.Id ?? Guid.Empty, SortBy = sortField, SortDescending = sortDescending, FolderId = externalFolderId @@ -843,8 +886,7 @@ namespace Emby.Server.Implementations.Channels var userCacheKey = string.Empty; - var hasCacheKey = channel as IHasCacheKey; - if (hasCacheKey != null) + if (channel is IHasCacheKey hasCacheKey) { userCacheKey = hasCacheKey.GetCacheKey(userId) ?? string.Empty; } @@ -919,59 +961,55 @@ namespace Emby.Server.Implementations.Channels if (info.Type == ChannelItemType.Folder) { - if (info.FolderType == ChannelFolderType.MusicAlbum) + switch (info.FolderType) { - item = GetItemById(info.Id, channelProvider.Name, out isNew); - } - else if (info.FolderType == ChannelFolderType.MusicArtist) - { - item = GetItemById(info.Id, channelProvider.Name, out isNew); - } - else if (info.FolderType == ChannelFolderType.PhotoAlbum) - { - item = GetItemById(info.Id, channelProvider.Name, out isNew); - } - else if (info.FolderType == ChannelFolderType.Series) - { - item = GetItemById(info.Id, channelProvider.Name, out isNew); - } - else if (info.FolderType == ChannelFolderType.Season) - { - item = GetItemById(info.Id, channelProvider.Name, out isNew); - } - else - { - item = GetItemById(info.Id, channelProvider.Name, out isNew); + case ChannelFolderType.MusicAlbum: + item = GetItemById(info.Id, channelProvider.Name, out isNew); + break; + case ChannelFolderType.MusicArtist: + item = GetItemById(info.Id, channelProvider.Name, out isNew); + break; + case ChannelFolderType.PhotoAlbum: + item = GetItemById(info.Id, channelProvider.Name, out isNew); + break; + case ChannelFolderType.Series: + item = GetItemById(info.Id, channelProvider.Name, out isNew); + break; + case ChannelFolderType.Season: + item = GetItemById(info.Id, channelProvider.Name, out isNew); + break; + default: + item = GetItemById(info.Id, channelProvider.Name, out isNew); + break; } } else if (info.MediaType == ChannelMediaType.Audio) { - if (info.ContentType == ChannelMediaContentType.Podcast) - { - item = GetItemById(info.Id, channelProvider.Name, out isNew); - } - else - { - item = GetItemById /// The progress. - /// The cancellation token. + /// A cancellation token that can be used to cancel the operation. /// The completed task. public async Task RefreshChannels(IProgress progress, CancellationToken cancellationToken) { @@ -384,8 +384,8 @@ namespace Emby.Server.Implementations.Channels /// Gets the dynamic media sources based on the provided item. /// /// The item. - /// The cancellation token. - /// The completed task. + /// A cancellation token that can be used to cancel the operation. + /// The task representing the operation to get the media sources. public async Task> GetDynamicMediaSources(BaseItem item, CancellationToken cancellationToken) { var channel = GetChannel(item.ChannelId); @@ -578,7 +578,8 @@ namespace Emby.Server.Implementations.Channels /// The provider. /// The features. /// The supported features. - public ChannelFeatures GetChannelFeaturesDto(Channel channel, + public ChannelFeatures GetChannelFeaturesDto( + Channel channel, IChannel provider, InternalChannelFeatures features) { @@ -961,27 +962,15 @@ namespace Emby.Server.Implementations.Channels if (info.Type == ChannelItemType.Folder) { - switch (info.FolderType) + item = info.FolderType switch { - case ChannelFolderType.MusicAlbum: - item = GetItemById(info.Id, channelProvider.Name, out isNew); - break; - case ChannelFolderType.MusicArtist: - item = GetItemById(info.Id, channelProvider.Name, out isNew); - break; - case ChannelFolderType.PhotoAlbum: - item = GetItemById(info.Id, channelProvider.Name, out isNew); - break; - case ChannelFolderType.Series: - item = GetItemById(info.Id, channelProvider.Name, out isNew); - break; - case ChannelFolderType.Season: - item = GetItemById(info.Id, channelProvider.Name, out isNew); - break; - default: - item = GetItemById(info.Id, channelProvider.Name, out isNew); - break; - } + ChannelFolderType.MusicAlbum => GetItemById(info.Id, channelProvider.Name, out isNew), + ChannelFolderType.MusicArtist => GetItemById(info.Id, channelProvider.Name, out isNew), + ChannelFolderType.PhotoAlbum => GetItemById(info.Id, channelProvider.Name, out isNew), + ChannelFolderType.Series => GetItemById(info.Id, channelProvider.Name, out isNew), + ChannelFolderType.Season => GetItemById(info.Id, channelProvider.Name, out isNew), + _ => GetItemById(info.Id, channelProvider.Name, out isNew) + }; } else if (info.MediaType == ChannelMediaType.Audio) { @@ -991,26 +980,14 @@ namespace Emby.Server.Implementations.Channels } else { - switch (info.ContentType) + item = info.ContentType switch { - case ChannelMediaContentType.Episode: - item = GetItemById(info.Id, channelProvider.Name, out isNew); - break; - case ChannelMediaContentType.Movie: - item = GetItemById(info.Id, channelProvider.Name, out isNew); - break; - default: - if (info.ContentType == ChannelMediaContentType.Trailer || info.ExtraType == ExtraType.Trailer) - { - item = GetItemById(info.Id, channelProvider.Name, out isNew); - } - else - { - item = GetItemById /// The STR. - /// The attrib. + /// The attrib. /// System.String. - /// attrib - public static string GetAttributeValue(this string str, string attrib) + /// str or attribute is empty. + public static string? GetAttributeValue(this string str, string attribute) { - if (string.IsNullOrEmpty(str)) + if (str.Length == 0) { - throw new ArgumentNullException(nameof(str)); + throw new ArgumentException("String can't be empty.", nameof(str)); } - if (string.IsNullOrEmpty(attrib)) + if (attribute.Length == 0) { - throw new ArgumentNullException(nameof(attrib)); + throw new ArgumentException("String can't be empty.", nameof(attribute)); } - string srch = "[" + attrib + "="; + string srch = "[" + attribute + "="; int start = str.IndexOf(srch, StringComparison.OrdinalIgnoreCase); - if (start > -1) + if (start != -1) { start += srch.Length; int end = str.IndexOf(']', start); @@ -37,7 +39,7 @@ namespace Emby.Server.Implementations.Library } // for imdbid we also accept pattern matching - if (string.Equals(attrib, "imdbid", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(attribute, "imdbid", StringComparison.OrdinalIgnoreCase)) { var m = Regex.Match(str, "tt([0-9]{7,8})", RegexOptions.IgnoreCase); return m.Success ? m.Value : null; diff --git a/Emby.Server.Implementations/Library/ResolverHelper.cs b/Emby.Server.Implementations/Library/ResolverHelper.cs index 34dcbbe285..7ca15b4e55 100644 --- a/Emby.Server.Implementations/Library/ResolverHelper.cs +++ b/Emby.Server.Implementations/Library/ResolverHelper.cs @@ -118,10 +118,12 @@ namespace Emby.Server.Implementations.Library { throw new ArgumentNullException(nameof(fileSystem)); } + if (item == null) { throw new ArgumentNullException(nameof(item)); } + if (args == null) { throw new ArgumentNullException(nameof(args)); diff --git a/Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs b/Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs index 23e22afd58..56e23d5492 100644 --- a/Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs +++ b/Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Reflection; +using MediaBrowser.Common.Extensions; namespace Emby.Server.Implementations.Services { @@ -81,7 +82,7 @@ namespace Emby.Server.Implementations.Services if (propertySerializerEntry.PropertyType == typeof(bool)) { //InputExtensions.cs#530 MVC Checkbox helper emits extra hidden input field, generating 2 values, first is the real value - propertyTextValue = LeftPart(propertyTextValue, ','); + propertyTextValue = StringExtensions.LeftPart(propertyTextValue, ',').ToString(); } var value = propertySerializerEntry.PropertyParseStringFn(propertyTextValue); @@ -95,19 +96,6 @@ namespace Emby.Server.Implementations.Services return instance; } - - public static string LeftPart(string strVal, char needle) - { - if (strVal == null) - { - return null; - } - - var pos = strVal.IndexOf(needle); - return pos == -1 - ? strVal - : strVal.Substring(0, pos); - } } internal static class TypeAccessor diff --git a/Emby.Server.Implementations/Services/UrlExtensions.cs b/Emby.Server.Implementations/Services/UrlExtensions.cs index 5d4407f3b8..483c63ade7 100644 --- a/Emby.Server.Implementations/Services/UrlExtensions.cs +++ b/Emby.Server.Implementations/Services/UrlExtensions.cs @@ -1,4 +1,5 @@ using System; +using MediaBrowser.Common.Extensions; namespace Emby.Server.Implementations.Services { @@ -13,25 +14,12 @@ namespace Emby.Server.Implementations.Services public static string GetMethodName(this Type type) { var typeName = type.FullName != null // can be null, e.g. generic types - ? LeftPart(type.FullName, "[[") // Generic Fullname - .Replace(type.Namespace + ".", string.Empty) // Trim Namespaces - .Replace("+", ".") // Convert nested into normal type + ? StringExtensions.LeftPart(type.FullName, "[[", StringComparison.Ordinal).ToString() // Generic Fullname + .Replace(type.Namespace + ".", string.Empty, StringComparison.Ordinal) // Trim Namespaces + .Replace("+", ".", StringComparison.Ordinal) // Convert nested into normal type : type.Name; return type.IsGenericParameter ? "'" + typeName : typeName; } - - private static string LeftPart(string strVal, string needle) - { - if (strVal == null) - { - return null; - } - - var pos = strVal.IndexOf(needle, StringComparison.OrdinalIgnoreCase); - return pos == -1 - ? strVal - : strVal.Substring(0, pos); - } } } diff --git a/Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs b/Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs index 1781df8b51..9c638f4395 100644 --- a/Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs +++ b/Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Net; using System.Net.Mime; +using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Net; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Extensions; @@ -216,14 +217,14 @@ namespace Emby.Server.Implementations.SocketSharp pi = pi.Slice(1); } - format = LeftPart(pi, '/'); + format = pi.LeftPart('/'); if (format.Length > FormatMaxLength) { return null; } } - format = LeftPart(format, '.'); + format = format.LeftPart('.'); if (format.Contains("json", StringComparison.OrdinalIgnoreCase)) { return "application/json"; @@ -235,16 +236,5 @@ namespace Emby.Server.Implementations.SocketSharp return null; } - - public static ReadOnlySpan LeftPart(ReadOnlySpan strVal, char needle) - { - if (strVal == null) - { - return null; - } - - var pos = strVal.IndexOf(needle); - return pos == -1 ? strVal : strVal.Slice(0, pos); - } } } diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 7705393576..928ca16128 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -321,7 +321,7 @@ namespace MediaBrowser.Api.Playback var encodingOptions = ServerConfigurationManager.GetEncodingOptions(); // enable throttling when NOT using hardware acceleration - if (encodingOptions.HardwareAccelerationType == string.Empty) + if (string.IsNullOrEmpty(encodingOptions.HardwareAccelerationType)) { return state.InputProtocol == MediaProtocol.File && state.RunTimeTicks.HasValue && @@ -330,6 +330,7 @@ namespace MediaBrowser.Api.Playback state.VideoType == VideoType.VideoFile && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase); } + return false; } diff --git a/MediaBrowser.Common/Extensions/BaseExtensions.cs b/MediaBrowser.Common/Extensions/BaseExtensions.cs index 08964420e7..40020093b6 100644 --- a/MediaBrowser.Common/Extensions/BaseExtensions.cs +++ b/MediaBrowser.Common/Extensions/BaseExtensions.cs @@ -1,3 +1,5 @@ +#nullable enable + using System; using System.Security.Cryptography; using System.Text; diff --git a/MediaBrowser.Common/Extensions/CopyToExtensions.cs b/MediaBrowser.Common/Extensions/CopyToExtensions.cs index 2ecbc6539b..94bf7c7401 100644 --- a/MediaBrowser.Common/Extensions/CopyToExtensions.cs +++ b/MediaBrowser.Common/Extensions/CopyToExtensions.cs @@ -1,3 +1,5 @@ +#nullable enable + using System.Collections.Generic; namespace MediaBrowser.Common.Extensions diff --git a/MediaBrowser.Common/Extensions/MethodNotAllowedException.cs b/MediaBrowser.Common/Extensions/MethodNotAllowedException.cs index 48e758ee4c..258bd6662c 100644 --- a/MediaBrowser.Common/Extensions/MethodNotAllowedException.cs +++ b/MediaBrowser.Common/Extensions/MethodNotAllowedException.cs @@ -1,3 +1,5 @@ +#nullable enable + using System; namespace MediaBrowser.Common.Extensions diff --git a/MediaBrowser.Common/Extensions/ProcessExtensions.cs b/MediaBrowser.Common/Extensions/ProcessExtensions.cs index c747871222..2f52ba196a 100644 --- a/MediaBrowser.Common/Extensions/ProcessExtensions.cs +++ b/MediaBrowser.Common/Extensions/ProcessExtensions.cs @@ -1,3 +1,5 @@ +#nullable enable + using System; using System.Diagnostics; using System.Threading; diff --git a/MediaBrowser.Common/Extensions/RateLimitExceededException.cs b/MediaBrowser.Common/Extensions/RateLimitExceededException.cs index 95802a4626..7c7bdaa92f 100644 --- a/MediaBrowser.Common/Extensions/RateLimitExceededException.cs +++ b/MediaBrowser.Common/Extensions/RateLimitExceededException.cs @@ -1,3 +1,4 @@ +#nullable enable #pragma warning disable CS1591 using System; diff --git a/MediaBrowser.Common/Extensions/ResourceNotFoundException.cs b/MediaBrowser.Common/Extensions/ResourceNotFoundException.cs index 22130c5a1e..ebac9d8e6b 100644 --- a/MediaBrowser.Common/Extensions/ResourceNotFoundException.cs +++ b/MediaBrowser.Common/Extensions/ResourceNotFoundException.cs @@ -1,3 +1,5 @@ +#nullable enable + using System; namespace MediaBrowser.Common.Extensions diff --git a/MediaBrowser.Common/Extensions/ShuffleExtensions.cs b/MediaBrowser.Common/Extensions/ShuffleExtensions.cs index 0432f36b57..459bec1105 100644 --- a/MediaBrowser.Common/Extensions/ShuffleExtensions.cs +++ b/MediaBrowser.Common/Extensions/ShuffleExtensions.cs @@ -1,3 +1,5 @@ +#nullable enable + using System; using System.Collections.Generic; diff --git a/MediaBrowser.Common/Extensions/StringExtensions.cs b/MediaBrowser.Common/Extensions/StringExtensions.cs new file mode 100644 index 0000000000..2ac29f8e52 --- /dev/null +++ b/MediaBrowser.Common/Extensions/StringExtensions.cs @@ -0,0 +1,37 @@ +#nullable enable + +using System; + +namespace MediaBrowser.Common.Extensions +{ + /// + /// Extensions methods to simplify string operations. + /// + public static class StringExtensions + { + /// + /// Returns the part left of the needle. + /// + /// The string to seek. + /// The needle to find. + /// The part left of the needle. + public static ReadOnlySpan LeftPart(this ReadOnlySpan str, char needle) + { + var pos = str.IndexOf(needle); + return pos == -1 ? str : str[..pos]; + } + + /// + /// Returns the part left of the needle. + /// + /// The string to seek. + /// The needle to find. + /// One of the enumeration values that specifies the rules for the search. + /// The part left of the needle. + public static ReadOnlySpan LeftPart(this ReadOnlySpan str, ReadOnlySpan needle, StringComparison stringComparison = default) + { + var pos = str.IndexOf(needle, stringComparison); + return pos == -1 ? str : str[..pos]; + } + } +} diff --git a/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs b/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs index cd387bd546..922eb4ca79 100644 --- a/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs +++ b/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs @@ -20,7 +20,7 @@ namespace MediaBrowser.Model.Entities } /// - /// Gets a provider id + /// Gets a provider id. /// /// The instance. /// The provider. @@ -31,7 +31,7 @@ namespace MediaBrowser.Model.Entities } /// - /// Gets a provider id + /// Gets a provider id. /// /// The instance. /// The name. @@ -53,7 +53,7 @@ namespace MediaBrowser.Model.Entities } /// - /// Sets a provider id + /// Sets a provider id. /// /// The instance. /// The name. @@ -89,7 +89,7 @@ namespace MediaBrowser.Model.Entities } /// - /// Sets a provider id + /// Sets a provider id. /// /// The instance. /// The provider. diff --git a/tests/Jellyfin.Common.Tests/Extensions/StringExtensionsTests.cs b/tests/Jellyfin.Common.Tests/Extensions/StringExtensionsTests.cs new file mode 100644 index 0000000000..89e7e8fde2 --- /dev/null +++ b/tests/Jellyfin.Common.Tests/Extensions/StringExtensionsTests.cs @@ -0,0 +1,35 @@ +using System; +using MediaBrowser.Common.Extensions; +using Xunit; + +namespace Jellyfin.Common.Tests.Extensions +{ + public class StringExtensionsTests + { + [Theory] + [InlineData("Banana split", ' ', "Banana")] + [InlineData("Banana split", 'q', "Banana split")] + public void LeftPartCharTest(string str, char needle, string result) + { + Assert.Equal(result, str.AsSpan().LeftPart(needle).ToString()); + } + + [Theory] + [InlineData("Banana split", " ", "Banana")] + [InlineData("Banana split test", " split", "Banana")] + public void LeftPartWithoutStringComparisonTest(string str, string needle, string result) + { + Assert.Equal(result, str.AsSpan().LeftPart(needle).ToString()); + } + + [Theory] + [InlineData("Banana split", " ", StringComparison.Ordinal, "Banana")] + [InlineData("Banana split test", " split", StringComparison.Ordinal, "Banana")] + [InlineData("Banana split test", " Split", StringComparison.Ordinal, "Banana split test")] + [InlineData("Banana split test", " Splït", StringComparison.InvariantCultureIgnoreCase, "Banana split test")] + public void LeftPartTest(string str, string needle, StringComparison stringComparison, string result) + { + Assert.Equal(result, str.AsSpan().LeftPart(needle, stringComparison).ToString()); + } + } +} diff --git a/tests/Jellyfin.Server.Implementations.Tests/HttpServer/ResponseFilterTests.cs b/tests/Jellyfin.Server.Implementations.Tests/HttpServer/ResponseFilterTests.cs new file mode 100644 index 0000000000..42d128dc68 --- /dev/null +++ b/tests/Jellyfin.Server.Implementations.Tests/HttpServer/ResponseFilterTests.cs @@ -0,0 +1,16 @@ +using Emby.Server.Implementations.HttpServer; +using Xunit; + +namespace Jellyfin.Server.Implementations.Tests.HttpServer +{ + public class HttpServerTests + { + [Theory] + [InlineData("This is a clean string.", "This is a clean string.")] + [InlineData("This isn't \n\ra clean string.", "This isn't a clean string.")] + public void RemoveControlCharactersTest(string input, string result) + { + Assert.Equal(result, ResponseFilter.RemoveControlCharacters(input)); + } + } +} diff --git a/tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs new file mode 100644 index 0000000000..7053ed3297 --- /dev/null +++ b/tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs @@ -0,0 +1,17 @@ +using Emby.Server.Implementations.Library; +using Xunit; + +namespace Jellyfin.Server.Implementations.Tests.Library +{ + public class PathExtensionsTests + { + [Theory] + [InlineData("Superman: Red Son [imdbid=tt10985510]", "imdbid", "tt10985510")] + [InlineData("Superman: Red Son - tt10985510", "imdbid", "tt10985510")] + [InlineData("Superman: Red Son", "imdbid", null)] + public void GetAttributeValueTest(string input, string attribute, string? result) + { + Assert.Equal(result, PathExtensions.GetAttributeValue(input, attribute)); + } + } +} From 958681cdffddc7ea24d92d126badb3372cfa5d41 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Mon, 20 Apr 2020 10:16:22 +0200 Subject: [PATCH 078/115] Cover more branches --- .../Extensions/StringExtensionsTests.cs | 6 +++--- .../HttpServer/ResponseFilterTests.cs | 6 ++++-- .../Library/PathExtensionsTests.cs | 12 +++++++++++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/Jellyfin.Common.Tests/Extensions/StringExtensionsTests.cs b/tests/Jellyfin.Common.Tests/Extensions/StringExtensionsTests.cs index 89e7e8fde2..0ed7673fdb 100644 --- a/tests/Jellyfin.Common.Tests/Extensions/StringExtensionsTests.cs +++ b/tests/Jellyfin.Common.Tests/Extensions/StringExtensionsTests.cs @@ -9,7 +9,7 @@ namespace Jellyfin.Common.Tests.Extensions [Theory] [InlineData("Banana split", ' ', "Banana")] [InlineData("Banana split", 'q', "Banana split")] - public void LeftPartCharTest(string str, char needle, string result) + public void LeftPart_ValidArgsCharNeedle_Correct(string str, char needle, string result) { Assert.Equal(result, str.AsSpan().LeftPart(needle).ToString()); } @@ -17,7 +17,7 @@ namespace Jellyfin.Common.Tests.Extensions [Theory] [InlineData("Banana split", " ", "Banana")] [InlineData("Banana split test", " split", "Banana")] - public void LeftPartWithoutStringComparisonTest(string str, string needle, string result) + public void LeftPart_ValidArgsWithoutStringComparison_Correct(string str, string needle, string result) { Assert.Equal(result, str.AsSpan().LeftPart(needle).ToString()); } @@ -27,7 +27,7 @@ namespace Jellyfin.Common.Tests.Extensions [InlineData("Banana split test", " split", StringComparison.Ordinal, "Banana")] [InlineData("Banana split test", " Split", StringComparison.Ordinal, "Banana split test")] [InlineData("Banana split test", " Splït", StringComparison.InvariantCultureIgnoreCase, "Banana split test")] - public void LeftPartTest(string str, string needle, StringComparison stringComparison, string result) + public void LeftPart_ValidArgs_Correct(string str, string needle, StringComparison stringComparison, string result) { Assert.Equal(result, str.AsSpan().LeftPart(needle, stringComparison).ToString()); } diff --git a/tests/Jellyfin.Server.Implementations.Tests/HttpServer/ResponseFilterTests.cs b/tests/Jellyfin.Server.Implementations.Tests/HttpServer/ResponseFilterTests.cs index 42d128dc68..39bd94b598 100644 --- a/tests/Jellyfin.Server.Implementations.Tests/HttpServer/ResponseFilterTests.cs +++ b/tests/Jellyfin.Server.Implementations.Tests/HttpServer/ResponseFilterTests.cs @@ -3,12 +3,14 @@ using Xunit; namespace Jellyfin.Server.Implementations.Tests.HttpServer { - public class HttpServerTests + public class ResponseFilterTests { [Theory] + [InlineData(null, null)] + [InlineData("", "")] [InlineData("This is a clean string.", "This is a clean string.")] [InlineData("This isn't \n\ra clean string.", "This isn't a clean string.")] - public void RemoveControlCharactersTest(string input, string result) + public void RemoveControlCharacters_ValidArgs_Correct(string? input, string? result) { Assert.Equal(result, ResponseFilter.RemoveControlCharacters(input)); } diff --git a/tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs index 7053ed3297..d2ed0d9257 100644 --- a/tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs +++ b/tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs @@ -1,3 +1,4 @@ +using System; using Emby.Server.Implementations.Library; using Xunit; @@ -9,9 +10,18 @@ namespace Jellyfin.Server.Implementations.Tests.Library [InlineData("Superman: Red Son [imdbid=tt10985510]", "imdbid", "tt10985510")] [InlineData("Superman: Red Son - tt10985510", "imdbid", "tt10985510")] [InlineData("Superman: Red Son", "imdbid", null)] - public void GetAttributeValueTest(string input, string attribute, string? result) + public void GetAttributeValue_ValidArgs_Correct(string input, string attribute, string? result) { Assert.Equal(result, PathExtensions.GetAttributeValue(input, attribute)); } + + [Theory] + [InlineData("", "")] + [InlineData("Superman: Red Son [imdbid=tt10985510]", "")] + [InlineData("", "imdbid")] + public void GetAttributeValue_EmptyString_ThrowsArgumentException(string input, string attribute) + { + Assert.Throws(() => PathExtensions.GetAttributeValue(input, attribute)); + } } } From 80f5dd1e59036c0dd0c75d0311d02842921c4737 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 20 Apr 2020 13:52:50 +0100 Subject: [PATCH 079/115] Fixed missing colons some colons were missing from the default ProtocolInfo string --- Emby.Dlna/Profiles/DefaultProfile.cs | 2 +- Emby.Dlna/Profiles/Xml/Default.xml | 2 +- Emby.Dlna/Profiles/Xml/Denon AVR.xml | 2 +- Emby.Dlna/Profiles/Xml/DirecTV HD-DVR.xml | 2 +- Emby.Dlna/Profiles/Xml/LG Smart TV.xml | 2 +- Emby.Dlna/Profiles/Xml/Linksys DMA2100.xml | 2 +- Emby.Dlna/Profiles/Xml/Marantz.xml | 2 +- Emby.Dlna/Profiles/Xml/MediaMonkey.xml | 2 +- Emby.Dlna/Profiles/Xml/Panasonic Viera.xml | 2 +- Emby.Dlna/Profiles/Xml/Popcorn Hour.xml | 2 +- Emby.Dlna/Profiles/Xml/Samsung Smart TV.xml | 2 +- Emby.Dlna/Profiles/Xml/Sharp Smart TV.xml | 2 +- Emby.Dlna/Profiles/Xml/Sony Bravia (2011).xml | 2 +- Emby.Dlna/Profiles/Xml/Sony Bravia (2012).xml | 2 +- Emby.Dlna/Profiles/Xml/Sony Bravia (2013).xml | 2 +- Emby.Dlna/Profiles/Xml/Sony Bravia (2014).xml | 2 +- Emby.Dlna/Profiles/Xml/Sony PlayStation 3.xml | 2 +- Emby.Dlna/Profiles/Xml/Sony PlayStation 4.xml | 2 +- Emby.Dlna/Profiles/Xml/WDTV Live.xml | 2 +- Emby.Dlna/Profiles/Xml/Xbox One.xml | 2 +- Emby.Dlna/Profiles/Xml/foobar2000.xml | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Emby.Dlna/Profiles/DefaultProfile.cs b/Emby.Dlna/Profiles/DefaultProfile.cs index d10804b228..2347ebd0d3 100644 --- a/Emby.Dlna/Profiles/DefaultProfile.cs +++ b/Emby.Dlna/Profiles/DefaultProfile.cs @@ -12,7 +12,7 @@ namespace Emby.Dlna.Profiles { Name = "Generic Device"; - ProtocolInfo = "http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:*"; + ProtocolInfo = "http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:*"; Manufacturer = "Jellyfin"; ModelDescription = "UPnP/AV 1.0 Compliant Media Server"; diff --git a/Emby.Dlna/Profiles/Xml/Default.xml b/Emby.Dlna/Profiles/Xml/Default.xml index daac4135a2..9460f9d5a1 100644 --- a/Emby.Dlna/Profiles/Xml/Default.xml +++ b/Emby.Dlna/Profiles/Xml/Default.xml @@ -21,7 +21,7 @@ 140000000 192000 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 0 false false diff --git a/Emby.Dlna/Profiles/Xml/Denon AVR.xml b/Emby.Dlna/Profiles/Xml/Denon AVR.xml index c76cd9a898..571786906c 100644 --- a/Emby.Dlna/Profiles/Xml/Denon AVR.xml +++ b/Emby.Dlna/Profiles/Xml/Denon AVR.xml @@ -26,7 +26,7 @@ 140000000 192000 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 0 false false diff --git a/Emby.Dlna/Profiles/Xml/DirecTV HD-DVR.xml b/Emby.Dlna/Profiles/Xml/DirecTV HD-DVR.xml index f2ce68ab5d..eea0febfdc 100644 --- a/Emby.Dlna/Profiles/Xml/DirecTV HD-DVR.xml +++ b/Emby.Dlna/Profiles/Xml/DirecTV HD-DVR.xml @@ -27,7 +27,7 @@ 140000000 192000 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 10 true true diff --git a/Emby.Dlna/Profiles/Xml/LG Smart TV.xml b/Emby.Dlna/Profiles/Xml/LG Smart TV.xml index a0f0e0ee8a..20f5ba79bf 100644 --- a/Emby.Dlna/Profiles/Xml/LG Smart TV.xml +++ b/Emby.Dlna/Profiles/Xml/LG Smart TV.xml @@ -27,7 +27,7 @@ 140000000 192000 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 10 false false diff --git a/Emby.Dlna/Profiles/Xml/Linksys DMA2100.xml b/Emby.Dlna/Profiles/Xml/Linksys DMA2100.xml index 55910c77f2..d01e3a145e 100644 --- a/Emby.Dlna/Profiles/Xml/Linksys DMA2100.xml +++ b/Emby.Dlna/Profiles/Xml/Linksys DMA2100.xml @@ -25,7 +25,7 @@ 140000000 192000 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 0 false false diff --git a/Emby.Dlna/Profiles/Xml/Marantz.xml b/Emby.Dlna/Profiles/Xml/Marantz.xml index a6345ab3f3..0cc9c86e87 100644 --- a/Emby.Dlna/Profiles/Xml/Marantz.xml +++ b/Emby.Dlna/Profiles/Xml/Marantz.xml @@ -27,7 +27,7 @@ 140000000 192000 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 0 false false diff --git a/Emby.Dlna/Profiles/Xml/MediaMonkey.xml b/Emby.Dlna/Profiles/Xml/MediaMonkey.xml index 2c2c3a1de4..9d5ddc3d1a 100644 --- a/Emby.Dlna/Profiles/Xml/MediaMonkey.xml +++ b/Emby.Dlna/Profiles/Xml/MediaMonkey.xml @@ -27,7 +27,7 @@ 140000000 192000 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 0 false false diff --git a/Emby.Dlna/Profiles/Xml/Panasonic Viera.xml b/Emby.Dlna/Profiles/Xml/Panasonic Viera.xml index 934f0550d3..8f766853bb 100644 --- a/Emby.Dlna/Profiles/Xml/Panasonic Viera.xml +++ b/Emby.Dlna/Profiles/Xml/Panasonic Viera.xml @@ -28,7 +28,7 @@ 140000000 192000 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 10 false false diff --git a/Emby.Dlna/Profiles/Xml/Popcorn Hour.xml b/Emby.Dlna/Profiles/Xml/Popcorn Hour.xml index eab220fae9..aa881d0147 100644 --- a/Emby.Dlna/Profiles/Xml/Popcorn Hour.xml +++ b/Emby.Dlna/Profiles/Xml/Popcorn Hour.xml @@ -21,7 +21,7 @@ 140000000 192000 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 0 false false diff --git a/Emby.Dlna/Profiles/Xml/Samsung Smart TV.xml b/Emby.Dlna/Profiles/Xml/Samsung Smart TV.xml index 3e6f56e5bb..7160a9c2eb 100644 --- a/Emby.Dlna/Profiles/Xml/Samsung Smart TV.xml +++ b/Emby.Dlna/Profiles/Xml/Samsung Smart TV.xml @@ -27,7 +27,7 @@ 140000000 192000 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 0 false false diff --git a/Emby.Dlna/Profiles/Xml/Sharp Smart TV.xml b/Emby.Dlna/Profiles/Xml/Sharp Smart TV.xml index 74240b8435..c9b907e580 100644 --- a/Emby.Dlna/Profiles/Xml/Sharp Smart TV.xml +++ b/Emby.Dlna/Profiles/Xml/Sharp Smart TV.xml @@ -27,7 +27,7 @@ 140000000 192000 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 0 true true diff --git a/Emby.Dlna/Profiles/Xml/Sony Bravia (2011).xml b/Emby.Dlna/Profiles/Xml/Sony Bravia (2011).xml index 49819ccfdb..e516ff512d 100644 --- a/Emby.Dlna/Profiles/Xml/Sony Bravia (2011).xml +++ b/Emby.Dlna/Profiles/Xml/Sony Bravia (2011).xml @@ -29,7 +29,7 @@ 192000 10 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 0 false false diff --git a/Emby.Dlna/Profiles/Xml/Sony Bravia (2012).xml b/Emby.Dlna/Profiles/Xml/Sony Bravia (2012).xml index aaad7b342c..88bd1c2f53 100644 --- a/Emby.Dlna/Profiles/Xml/Sony Bravia (2012).xml +++ b/Emby.Dlna/Profiles/Xml/Sony Bravia (2012).xml @@ -29,7 +29,7 @@ 192000 10 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 0 false false diff --git a/Emby.Dlna/Profiles/Xml/Sony Bravia (2013).xml b/Emby.Dlna/Profiles/Xml/Sony Bravia (2013).xml index 8e2e8dbaa4..3ca9893cdc 100644 --- a/Emby.Dlna/Profiles/Xml/Sony Bravia (2013).xml +++ b/Emby.Dlna/Profiles/Xml/Sony Bravia (2013).xml @@ -29,7 +29,7 @@ 192000 10 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 0 false false diff --git a/Emby.Dlna/Profiles/Xml/Sony Bravia (2014).xml b/Emby.Dlna/Profiles/Xml/Sony Bravia (2014).xml index 17a6135e1f..8804a75dfa 100644 --- a/Emby.Dlna/Profiles/Xml/Sony Bravia (2014).xml +++ b/Emby.Dlna/Profiles/Xml/Sony Bravia (2014).xml @@ -29,7 +29,7 @@ 192000 10 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 0 false false diff --git a/Emby.Dlna/Profiles/Xml/Sony PlayStation 3.xml b/Emby.Dlna/Profiles/Xml/Sony PlayStation 3.xml index df385135cd..bafa44b828 100644 --- a/Emby.Dlna/Profiles/Xml/Sony PlayStation 3.xml +++ b/Emby.Dlna/Profiles/Xml/Sony PlayStation 3.xml @@ -29,7 +29,7 @@ 192000 10 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 0 false false diff --git a/Emby.Dlna/Profiles/Xml/Sony PlayStation 4.xml b/Emby.Dlna/Profiles/Xml/Sony PlayStation 4.xml index 20f50f6b63..eb8e645b31 100644 --- a/Emby.Dlna/Profiles/Xml/Sony PlayStation 4.xml +++ b/Emby.Dlna/Profiles/Xml/Sony PlayStation 4.xml @@ -29,7 +29,7 @@ 192000 10 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 0 false false diff --git a/Emby.Dlna/Profiles/Xml/WDTV Live.xml b/Emby.Dlna/Profiles/Xml/WDTV Live.xml index 05380e33a6..ccb74ee646 100644 --- a/Emby.Dlna/Profiles/Xml/WDTV Live.xml +++ b/Emby.Dlna/Profiles/Xml/WDTV Live.xml @@ -28,7 +28,7 @@ 140000000 192000 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 5 false false diff --git a/Emby.Dlna/Profiles/Xml/Xbox One.xml b/Emby.Dlna/Profiles/Xml/Xbox One.xml index 5f5cf1af31..26a65bbd44 100644 --- a/Emby.Dlna/Profiles/Xml/Xbox One.xml +++ b/Emby.Dlna/Profiles/Xml/Xbox One.xml @@ -28,7 +28,7 @@ 140000000 192000 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 40 false false diff --git a/Emby.Dlna/Profiles/Xml/foobar2000.xml b/Emby.Dlna/Profiles/Xml/foobar2000.xml index f3eedb35c6..5ce75ace55 100644 --- a/Emby.Dlna/Profiles/Xml/foobar2000.xml +++ b/Emby.Dlna/Profiles/Xml/foobar2000.xml @@ -27,7 +27,7 @@ 140000000 192000 - http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:* + http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:* 0 false false From c430a7ed8faa40788c32b89852310981b7c1cf83 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Tue, 21 Apr 2020 10:18:26 +0200 Subject: [PATCH 080/115] Address comments --- .../Library/PathExtensions.cs | 2 +- .../Extensions/StringExtensions.cs | 22 +++++++++---------- .../Extensions/StringExtensionsTests.cs | 20 ++++++++++++----- .../Library/PathExtensionsTests.cs | 4 ++-- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/Emby.Server.Implementations/Library/PathExtensions.cs b/Emby.Server.Implementations/Library/PathExtensions.cs index b74cad067b..06ff3e611b 100644 --- a/Emby.Server.Implementations/Library/PathExtensions.cs +++ b/Emby.Server.Implementations/Library/PathExtensions.cs @@ -16,7 +16,7 @@ namespace Emby.Server.Implementations.Library /// The STR. /// The attrib. /// System.String. - /// str or attribute is empty. + /// or is empty. public static string? GetAttributeValue(this string str, string attribute) { if (str.Length == 0) diff --git a/MediaBrowser.Common/Extensions/StringExtensions.cs b/MediaBrowser.Common/Extensions/StringExtensions.cs index 2ac29f8e52..7643017412 100644 --- a/MediaBrowser.Common/Extensions/StringExtensions.cs +++ b/MediaBrowser.Common/Extensions/StringExtensions.cs @@ -10,28 +10,28 @@ namespace MediaBrowser.Common.Extensions public static class StringExtensions { /// - /// Returns the part left of the needle. + /// Returns the part on the left of the needle. /// - /// The string to seek. + /// The string to seek. /// The needle to find. - /// The part left of the needle. - public static ReadOnlySpan LeftPart(this ReadOnlySpan str, char needle) + /// The part left of the . + public static ReadOnlySpan LeftPart(this ReadOnlySpan haystack, char needle) { - var pos = str.IndexOf(needle); - return pos == -1 ? str : str[..pos]; + var pos = haystack.IndexOf(needle); + return pos == -1 ? haystack : haystack[..pos]; } /// - /// Returns the part left of the needle. + /// Returns the part on the left of the needle. /// - /// The string to seek. + /// The string to seek. /// The needle to find. /// One of the enumeration values that specifies the rules for the search. /// The part left of the needle. - public static ReadOnlySpan LeftPart(this ReadOnlySpan str, ReadOnlySpan needle, StringComparison stringComparison = default) + public static ReadOnlySpan LeftPart(this ReadOnlySpan haystack, ReadOnlySpan needle, StringComparison stringComparison = default) { - var pos = str.IndexOf(needle, stringComparison); - return pos == -1 ? str : str[..pos]; + var pos = haystack.IndexOf(needle, stringComparison); + return pos == -1 ? haystack : haystack[..pos]; } } } diff --git a/tests/Jellyfin.Common.Tests/Extensions/StringExtensionsTests.cs b/tests/Jellyfin.Common.Tests/Extensions/StringExtensionsTests.cs index 0ed7673fdb..8bf613f05f 100644 --- a/tests/Jellyfin.Common.Tests/Extensions/StringExtensionsTests.cs +++ b/tests/Jellyfin.Common.Tests/Extensions/StringExtensionsTests.cs @@ -7,29 +7,37 @@ namespace Jellyfin.Common.Tests.Extensions public class StringExtensionsTests { [Theory] + [InlineData("", 'q', "")] [InlineData("Banana split", ' ', "Banana")] [InlineData("Banana split", 'q', "Banana split")] - public void LeftPart_ValidArgsCharNeedle_Correct(string str, char needle, string result) + public void LeftPart_ValidArgsCharNeedle_Correct(string str, char needle, string expectedResult) { - Assert.Equal(result, str.AsSpan().LeftPart(needle).ToString()); + var result = str.AsSpan().LeftPart(needle).ToString(); + Assert.Equal(expectedResult, result); } [Theory] + [InlineData("", "", "")] + [InlineData("", "q", "")] + [InlineData("Banana split", "", "")] [InlineData("Banana split", " ", "Banana")] [InlineData("Banana split test", " split", "Banana")] - public void LeftPart_ValidArgsWithoutStringComparison_Correct(string str, string needle, string result) + public void LeftPart_ValidArgsWithoutStringComparison_Correct(string str, string needle, string expectedResult) { - Assert.Equal(result, str.AsSpan().LeftPart(needle).ToString()); + var result = str.AsSpan().LeftPart(needle).ToString(); + Assert.Equal(expectedResult, result); } [Theory] + [InlineData("", "", StringComparison.Ordinal, "")] [InlineData("Banana split", " ", StringComparison.Ordinal, "Banana")] [InlineData("Banana split test", " split", StringComparison.Ordinal, "Banana")] [InlineData("Banana split test", " Split", StringComparison.Ordinal, "Banana split test")] [InlineData("Banana split test", " Splït", StringComparison.InvariantCultureIgnoreCase, "Banana split test")] - public void LeftPart_ValidArgs_Correct(string str, string needle, StringComparison stringComparison, string result) + public void LeftPart_ValidArgs_Correct(string str, string needle, StringComparison stringComparison, string expectedResult) { - Assert.Equal(result, str.AsSpan().LeftPart(needle, stringComparison).ToString()); + var result = str.AsSpan().LeftPart(needle, stringComparison).ToString(); + Assert.Equal(expectedResult, result); } } } diff --git a/tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs index d2ed0d9257..c771f5f4ae 100644 --- a/tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs +++ b/tests/Jellyfin.Server.Implementations.Tests/Library/PathExtensionsTests.cs @@ -10,9 +10,9 @@ namespace Jellyfin.Server.Implementations.Tests.Library [InlineData("Superman: Red Son [imdbid=tt10985510]", "imdbid", "tt10985510")] [InlineData("Superman: Red Son - tt10985510", "imdbid", "tt10985510")] [InlineData("Superman: Red Son", "imdbid", null)] - public void GetAttributeValue_ValidArgs_Correct(string input, string attribute, string? result) + public void GetAttributeValue_ValidArgs_Correct(string input, string attribute, string? expectedResult) { - Assert.Equal(result, PathExtensions.GetAttributeValue(input, attribute)); + Assert.Equal(expectedResult, PathExtensions.GetAttributeValue(input, attribute)); } [Theory] From e21d6160c1e77843620c70551256a386ae53072c Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Tue, 21 Apr 2020 10:21:20 +0200 Subject: [PATCH 081/115] Address comments --- tests/Jellyfin.Model.Tests/Extensions/StringHelperTests.cs | 4 ++-- .../Jellyfin.Naming.Tests/Subtitles/SubtitleParserTests.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Jellyfin.Model.Tests/Extensions/StringHelperTests.cs b/tests/Jellyfin.Model.Tests/Extensions/StringHelperTests.cs index 7b37b49a96..51633e157c 100644 --- a/tests/Jellyfin.Model.Tests/Extensions/StringHelperTests.cs +++ b/tests/Jellyfin.Model.Tests/Extensions/StringHelperTests.cs @@ -11,9 +11,9 @@ namespace Jellyfin.Model.Tests.Extensions [InlineData("banana", "Banana")] [InlineData("Banana", "Banana")] [InlineData("ä", "Ä")] - public void StringHelper_ValidArgs_Success(string str, string result) + public void StringHelper_ValidArgs_Success(string input, string expectedResult) { - Assert.Equal(result, StringHelper.FirstToUpper(str)); + Assert.Equal(expectedResult, StringHelper.FirstToUpper(input)); } } } diff --git a/tests/Jellyfin.Naming.Tests/Subtitles/SubtitleParserTests.cs b/tests/Jellyfin.Naming.Tests/Subtitles/SubtitleParserTests.cs index a438318ca7..40d80607c8 100644 --- a/tests/Jellyfin.Naming.Tests/Subtitles/SubtitleParserTests.cs +++ b/tests/Jellyfin.Naming.Tests/Subtitles/SubtitleParserTests.cs @@ -17,7 +17,7 @@ namespace Jellyfin.Naming.Tests.Subtitles [InlineData("The Skin I Live In (2011).eng.foreign.srt", "eng", false, true)] [InlineData("The Skin I Live In (2011).eng.default.foreign.srt", "eng", true, true)] [InlineData("The Skin I Live In (2011).default.foreign.eng.srt", "eng", true, true)] - public void SubtitleParser_ValidFileNames_Parses(string input, string language, bool isDefault, bool isForced) + public void SubtitleParser_ValidFileName_Parses(string input, string language, bool isDefault, bool isForced) { var parser = new SubtitleParser(_namingOptions); @@ -30,7 +30,7 @@ namespace Jellyfin.Naming.Tests.Subtitles [Theory] [InlineData("The Skin I Live In (2011).mp4")] - public void SubtitleParser_InvalidFileNames_ReturnsNull(string input) + public void SubtitleParser_InvalidFileName_ReturnsNull(string input) { var parser = new SubtitleParser(_namingOptions); @@ -38,7 +38,7 @@ namespace Jellyfin.Naming.Tests.Subtitles } [Fact] - public void SubtitleParser_EmptyFileNames_ThrowsArgumentException() + public void SubtitleParser_EmptyFileName_ThrowsArgumentException() { Assert.Throws(() => new SubtitleParser(_namingOptions).ParseFile(string.Empty)); } From f5f990154456af149b60f7436fbdf6ac0c2281f4 Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Wed, 22 Apr 2020 09:55:35 -0400 Subject: [PATCH 082/115] Fixed build --- Emby.Server.Implementations/Activity/ActivityRepository.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Emby.Server.Implementations/Activity/ActivityRepository.cs b/Emby.Server.Implementations/Activity/ActivityRepository.cs index 83471935d3..22796ba3f8 100644 --- a/Emby.Server.Implementations/Activity/ActivityRepository.cs +++ b/Emby.Server.Implementations/Activity/ActivityRepository.cs @@ -85,8 +85,6 @@ namespace Emby.Server.Implementations.Activity } } - private const string BaseActivitySelectText = "select Id, Name, Overview, ShortOverview, Type, ItemId, UserId, DateCreated, LogSeverity from ActivityLog"; - /// public void Create(ActivityLogEntry entry) { From eee02a355af0760c55dc9c1d42b9f5f623135b08 Mon Sep 17 00:00:00 2001 From: ZadenRB Date: Wed, 22 Apr 2020 10:06:37 -0600 Subject: [PATCH 083/115] Adds produces annotation to the base controller to indicate application/json as the response type for endpoints --- Jellyfin.Api/BaseJellyfinApiController.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Jellyfin.Api/BaseJellyfinApiController.cs b/Jellyfin.Api/BaseJellyfinApiController.cs index 1f4508e6cb..51bd384b3b 100644 --- a/Jellyfin.Api/BaseJellyfinApiController.cs +++ b/Jellyfin.Api/BaseJellyfinApiController.cs @@ -7,6 +7,7 @@ namespace Jellyfin.Api /// [ApiController] [Route("[controller]")] + [Produces("application/json")] public class BaseJellyfinApiController : ControllerBase { } From 2066b0f68f96a14d7b5a5e511ce9099c7a1cada7 Mon Sep 17 00:00:00 2001 From: ZadenRB Date: Thu, 23 Apr 2020 16:15:59 -0600 Subject: [PATCH 084/115] Use builtin JSON Mime type constant --- Jellyfin.Api/BaseJellyfinApiController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jellyfin.Api/BaseJellyfinApiController.cs b/Jellyfin.Api/BaseJellyfinApiController.cs index 51bd384b3b..a34f9eb62f 100644 --- a/Jellyfin.Api/BaseJellyfinApiController.cs +++ b/Jellyfin.Api/BaseJellyfinApiController.cs @@ -1,3 +1,4 @@ +using System.Net.Mime; using Microsoft.AspNetCore.Mvc; namespace Jellyfin.Api @@ -7,7 +8,7 @@ namespace Jellyfin.Api /// [ApiController] [Route("[controller]")] - [Produces("application/json")] + [Produces(MediaTypeNames.Application.Json)] public class BaseJellyfinApiController : ControllerBase { } From 01f49137fcb2c545f73d2d1295a7a7e0d8dc2000 Mon Sep 17 00:00:00 2001 From: Aragon Date: Fri, 24 Apr 2020 20:50:06 +0000 Subject: [PATCH 085/115] Translated using Weblate (Hebrew) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/he/ --- Emby.Server.Implementations/Localization/Core/he.json | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Emby.Server.Implementations/Localization/Core/he.json b/Emby.Server.Implementations/Localization/Core/he.json index 1ce8b08a0a..2662913621 100644 --- a/Emby.Server.Implementations/Localization/Core/he.json +++ b/Emby.Server.Implementations/Localization/Core/he.json @@ -1,7 +1,7 @@ { "Albums": "אלבומים", "AppDeviceValues": "יישום: {0}, מכשיר: {1}", - "Application": "אפליקציה", + "Application": "יישום", "Artists": "אומנים", "AuthenticationSucceededWithUserName": "{0} אומת בהצלחה", "Books": "ספרים", @@ -92,5 +92,12 @@ "UserStoppedPlayingItemWithValues": "{0} סיים לנגן את {1} על {2}", "ValueHasBeenAddedToLibrary": "{0} has been added to your media library", "ValueSpecialEpisodeName": "מיוחד- {0}", - "VersionNumber": "Version {0}" + "VersionNumber": "Version {0}", + "TaskRefreshLibrary": "סרוק ספריית מדיה", + "TaskRefreshChapterImages": "חלץ תמונות פרקים", + "TaskCleanCacheDescription": "מחק קבצי מטמון שלא בשימוש המערכת.", + "TaskCleanCache": "נקה תיקיית מטמון", + "TasksApplicationCategory": "יישום", + "TasksLibraryCategory": "ספרייה", + "TasksMaintenanceCategory": "תחזוקה" } From 153ea9f027d038ae86f644348eac7b43778d751d Mon Sep 17 00:00:00 2001 From: Andreas B <6439218+YouKnowBlom@users.noreply.github.com> Date: Sat, 25 Apr 2020 15:22:09 +0200 Subject: [PATCH 086/115] Fix error in HLS codecs field when level is null --- .../Playback/Hls/DynamicHlsService.cs | 80 ++++++++++++------- 1 file changed, 52 insertions(+), 28 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index ce25676ff5..9071ef18fd 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -722,11 +722,37 @@ namespace MediaBrowser.Api.Playback.Hls //return state.VideoRequest.VideoBitRate.HasValue; } + /// + /// Get the H.26X level of the output video stream. + /// + /// StreamState of the current stream. + /// H.26X level of the output video stream. + private int? GetOutputVideoCodecLevel(StreamState state) + { + string levelString; + if (string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase) + && state.VideoStream.Level.HasValue) + { + levelString = state.VideoStream?.Level.ToString(); + } + else + { + levelString = state.GetRequestedLevel(state.ActualOutputVideoCodec); + } + + if (int.TryParse(levelString, NumberStyles.Integer, CultureInfo.InvariantCulture, out var parsedLevel)) + { + return parsedLevel; + } + + return null; + } + /// /// Gets a formatted string of the output audio codec, for use in the CODECS field. /// /// - /// + /// /// StreamState of the current stream. /// Formatted audio codec string. private string GetPlaylistAudioCodecs(StreamState state) @@ -761,18 +787,24 @@ namespace MediaBrowser.Api.Playback.Hls /// /// StreamState of the current stream. /// Formatted video codec string. - private string GetPlaylistVideoCodecs(StreamState state) + private string GetPlaylistVideoCodecs(StreamState state, string codec, int level) { - int level = Convert.ToInt32(state.GetRequestedLevel(state.ActualOutputVideoCodec)); + if (level == 0) + { + // This is 0 when there's no requested H.26X level in the device profile + // and the source is not encoded in H.26X + Logger.LogError("Got invalid H.26X level when building CODECS field for HLS master playlist"); + return string.Empty; + } - if (string.Equals(state.ActualOutputVideoCodec, "h264", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(codec, "h264", StringComparison.OrdinalIgnoreCase)) { string profile = state.GetRequestedProfiles("h264").FirstOrDefault(); return HlsCodecStringFactory.GetH264String(profile, level); } - else if (string.Equals(state.ActualOutputVideoCodec, "h265", StringComparison.OrdinalIgnoreCase) - || string.Equals(state.ActualOutputVideoCodec, "hevc", StringComparison.OrdinalIgnoreCase)) + else if (string.Equals(codec, "h265", StringComparison.OrdinalIgnoreCase) + || string.Equals(codec, "hevc", StringComparison.OrdinalIgnoreCase)) { string profile = state.GetRequestedProfiles("h265").FirstOrDefault(); @@ -787,7 +819,7 @@ namespace MediaBrowser.Api.Playback.Hls /// the active streams output video and audio codecs. /// /// - /// + /// /// /// StringBuilder to append the field to. /// StreamState of the current stream. @@ -795,9 +827,10 @@ namespace MediaBrowser.Api.Playback.Hls { // Video string videoCodecs = string.Empty; - if (!string.IsNullOrEmpty(state.ActualOutputVideoCodec)) + int? videoCodecLevel = GetOutputVideoCodecLevel(state); + if (!string.IsNullOrEmpty(state.ActualOutputVideoCodec) && videoCodecLevel.HasValue) { - videoCodecs = GetPlaylistVideoCodecs(state); + videoCodecs = GetPlaylistVideoCodecs(state, state.ActualOutputVideoCodec, videoCodecLevel.Value); } // Audio @@ -807,26 +840,17 @@ namespace MediaBrowser.Api.Playback.Hls audioCodecs = GetPlaylistAudioCodecs(state); } - if (!string.IsNullOrEmpty(videoCodecs) || !string.IsNullOrEmpty(audioCodecs)) + StringBuilder codecs = new StringBuilder(); + + codecs.Append(videoCodecs) + .Append(',') + .Append(audioCodecs); + + if (codecs.Length > 1) { - builder.Append(",CODECS=\""); - - if (!string.IsNullOrEmpty(videoCodecs) && !string.IsNullOrEmpty(audioCodecs)) - { - builder.Append(videoCodecs) - .Append(',') - .Append(audioCodecs); - } - else if (!string.IsNullOrEmpty(videoCodecs)) - { - builder.Append(videoCodecs); - } - else if (!string.IsNullOrEmpty(audioCodecs)) - { - builder.Append(audioCodecs); - } - - builder.Append('"'); + builder.Append(",CODECS=\"") + .Append(codecs) + .Append('"'); } } From 233337256fc997c05bd6f0093a532cea0d54f227 Mon Sep 17 00:00:00 2001 From: sparky8251 Date: Sat, 25 Apr 2020 21:35:51 -0400 Subject: [PATCH 087/115] Add prometheus exporters --- Jellyfin.Server/Jellyfin.Server.csproj | 3 +++ Jellyfin.Server/Program.cs | 4 ++++ Jellyfin.Server/Startup.cs | 3 +++ 3 files changed, 10 insertions(+) diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj index 270cdeaaf5..c49fc41f46 100644 --- a/Jellyfin.Server/Jellyfin.Server.csproj +++ b/Jellyfin.Server/Jellyfin.Server.csproj @@ -43,6 +43,9 @@ + + + diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 193d30e3a7..be070f9d52 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -28,6 +28,7 @@ using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; +using Prometheus.DotNetRuntime; using Serilog; using Serilog.Extensions.Logging; using SQLitePCL; @@ -161,6 +162,9 @@ namespace Jellyfin.Server ApplicationHost.LogEnvironmentInfo(_logger, appPaths); + // Initialize runtime stat collection + IDisposable collector = DotNetRuntimeStatsBuilder.Default().StartCollecting(); + // Make sure we have all the code pages we can get // Ref: https://docs.microsoft.com/en-us/dotnet/api/system.text.codepagesencodingprovider.instance?view=netcore-3.0#remarks Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); diff --git a/Jellyfin.Server/Startup.cs b/Jellyfin.Server/Startup.cs index 4d7d56e9d4..2e5f843e3a 100644 --- a/Jellyfin.Server/Startup.cs +++ b/Jellyfin.Server/Startup.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using Prometheus; namespace Jellyfin.Server { @@ -69,9 +70,11 @@ namespace Jellyfin.Server app.UseJellyfinApiSwagger(); app.UseRouting(); app.UseAuthorization(); + app.UseHttpMetrics(); // Must be registered after any middleware that could chagne HTTP response codes or the data will be bad app.UseEndpoints(endpoints => { endpoints.MapControllers(); + endpoints.MapMetrics(); }); app.Use(serverApplicationHost.ExecuteHttpHandlerAsync); From c689bf457c5f07774f74d2cdecabc1567ac16e77 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 25 Apr 2020 22:12:19 -0400 Subject: [PATCH 088/115] Correct dpkg conditional logic Co-Authored-By: Vasily --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index b4792a25ed..1db02af983 100755 --- a/build.sh +++ b/build.sh @@ -34,7 +34,7 @@ list_platforms() { } do_build_native() { - if [[ -f $( which dpkg ) && $( dpkg --print-architecture | head -1 ) != "${PLATFORM##*.}" ]]; then + if [[ ! -f $( which dpkg ) || $( dpkg --print-architecture | head -1 ) != "${PLATFORM##*.}" ]]; then echo "Cross-building is not supported for native builds, use 'docker' builds on amd64 for cross-building." exit 1 fi From a327e4ccac9937cd982f36ba582774c20e824814 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 25 Apr 2020 22:13:21 -0400 Subject: [PATCH 089/115] Update fedora/jellyfin.spec Co-Authored-By: Vasily --- fedora/jellyfin.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedora/jellyfin.spec b/fedora/jellyfin.spec index 4e1045d740..9311864a63 100644 --- a/fedora/jellyfin.spec +++ b/fedora/jellyfin.spec @@ -28,7 +28,7 @@ BuildRequires: libcurl-devel, fontconfig-devel, freetype-devel, openssl-devel, # COPR @dotnet-sig/dotnet or # https://packages.microsoft.com/rhel/7/prod/ BuildRequires: dotnet-runtime-3.1, dotnet-sdk-3.1 -Requires: %{name}-server = %{version}-%{release}, %{name}-web >= 1, %{name}-web < 2 +Requires: %{name}-server = %{version}-%{release}, %{name}-web >= 10.6, %{name}-web < 10.7 # Disable Automatic Dependency Processing AutoReqProv: no From 68c7a914c3acbd21a9ca879829bf6a670d4cf185 Mon Sep 17 00:00:00 2001 From: sparky8251 Date: Sun, 26 Apr 2020 11:28:17 -0400 Subject: [PATCH 090/115] Added option to disable metrics collection and defaulted it to off --- .../ApplicationHost.cs | 7 ++++ .../Emby.Server.Implementations.csproj | 1 + Jellyfin.Server/Jellyfin.Server.csproj | 1 - .../Routines/DisableMetricsCollection.cs | 33 +++++++++++++++++++ Jellyfin.Server/Program.cs | 4 --- Jellyfin.Server/Startup.cs | 11 +++++-- .../Configuration/ServerConfiguration.cs | 6 ++++ 7 files changed, 56 insertions(+), 7 deletions(-) create mode 100644 Jellyfin.Server/Migrations/Routines/DisableMetricsCollection.cs diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 33aec1a06b..7e7b785d85 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -106,6 +106,7 @@ using Microsoft.AspNetCore.Http.Extensions; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using OperatingSystem = MediaBrowser.Common.System.OperatingSystem; +using Prometheus.DotNetRuntime; namespace Emby.Server.Implementations { @@ -259,6 +260,12 @@ namespace Emby.Server.Implementations _startupOptions = options; + // Initialize runtime stat collection + if (ServerConfigurationManager.Configuration.EnableMetrics) + { + IDisposable collector = DotNetRuntimeStatsBuilder.Default().StartCollecting(); + } + fileSystem.AddShortcutHandler(new MbLinkShortcutHandler(fileSystem)); _networkManager.NetworkChanged += OnNetworkChanged; diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj index bf4a0d939f..44fc932e39 100644 --- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj +++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj @@ -39,6 +39,7 @@ + diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj index c49fc41f46..88114d9994 100644 --- a/Jellyfin.Server/Jellyfin.Server.csproj +++ b/Jellyfin.Server/Jellyfin.Server.csproj @@ -45,7 +45,6 @@ - diff --git a/Jellyfin.Server/Migrations/Routines/DisableMetricsCollection.cs b/Jellyfin.Server/Migrations/Routines/DisableMetricsCollection.cs new file mode 100644 index 0000000000..b5dc43614e --- /dev/null +++ b/Jellyfin.Server/Migrations/Routines/DisableMetricsCollection.cs @@ -0,0 +1,33 @@ +using System; +using MediaBrowser.Common.Configuration; +using MediaBrowser.Model.Configuration; +using Microsoft.Extensions.Logging; + +namespace Jellyfin.Server.Migrations.Routines +{ + /// + /// Disable metrics collections for all installations since it can be a security risk if not properly secured. + /// + internal class DisableMetricsCollection : IMigrationRoutine + { + /// + public Guid Id => Guid.Parse("{4124C2CD-E939-4FFB-9BE9-9B311C413638}"); + + /// + public string Name => "DisableMetricsCollection"; + + /// + public void Perform(CoreAppHost host, ILogger logger) + { + // Set EnableMetrics to false since it can leak sensitive information if not properly secured + var metrics = host.ServerConfigurationManager.Configuration.EnableMetrics; + if (metrics) + { + logger.LogInformation("Disabling metrics collection during migration"); + metrics = false; + + host.ServerConfigurationManager.SaveConfiguration("false", metrics); + } + } + } +} diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index be070f9d52..193d30e3a7 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -28,7 +28,6 @@ using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -using Prometheus.DotNetRuntime; using Serilog; using Serilog.Extensions.Logging; using SQLitePCL; @@ -162,9 +161,6 @@ namespace Jellyfin.Server ApplicationHost.LogEnvironmentInfo(_logger, appPaths); - // Initialize runtime stat collection - IDisposable collector = DotNetRuntimeStatsBuilder.Default().StartCollecting(); - // Make sure we have all the code pages we can get // Ref: https://docs.microsoft.com/en-us/dotnet/api/system.text.codepagesencodingprovider.instance?view=netcore-3.0#remarks Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); diff --git a/Jellyfin.Server/Startup.cs b/Jellyfin.Server/Startup.cs index 2e5f843e3a..8f85161c7d 100644 --- a/Jellyfin.Server/Startup.cs +++ b/Jellyfin.Server/Startup.cs @@ -70,11 +70,18 @@ namespace Jellyfin.Server app.UseJellyfinApiSwagger(); app.UseRouting(); app.UseAuthorization(); - app.UseHttpMetrics(); // Must be registered after any middleware that could chagne HTTP response codes or the data will be bad + if (_serverConfigurationManager.Configuration.EnableMetrics) + { + app.UseHttpMetrics(); // Must be registered after any middleware that could chagne HTTP response codes or the data will be bad + } + app.UseEndpoints(endpoints => { endpoints.MapControllers(); - endpoints.MapMetrics(); + if (_serverConfigurationManager.Configuration.EnableMetrics) + { + endpoints.MapMetrics(); + } }); app.Use(serverApplicationHost.ExecuteHttpHandlerAsync); diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index b5e8d5589a..063ccd9b9a 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -19,6 +19,11 @@ namespace MediaBrowser.Model.Configuration /// public bool EnableUPnP { get; set; } + /// + /// Gets or sets a value indicating whether to enable prometheus metrics exporting. + /// + public bool EnableMetrics { get; set; } + /// /// Gets or sets the public mapped port. /// @@ -246,6 +251,7 @@ namespace MediaBrowser.Model.Configuration PublicHttpsPort = DefaultHttpsPort; HttpServerPortNumber = DefaultHttpPort; HttpsPortNumber = DefaultHttpsPort; + EnableMetrics = false; EnableHttps = false; EnableDashboardResponseCaching = true; EnableCaseSensitiveItemIds = true; From 997b71bbefa91f7a7fd9b499cb3d2ca656de466d Mon Sep 17 00:00:00 2001 From: sparky8251 Date: Sun, 26 Apr 2020 11:52:01 -0400 Subject: [PATCH 091/115] Metrics endpoint now respects baseurl --- Jellyfin.Server/Startup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jellyfin.Server/Startup.cs b/Jellyfin.Server/Startup.cs index 8f85161c7d..2cc7cff87e 100644 --- a/Jellyfin.Server/Startup.cs +++ b/Jellyfin.Server/Startup.cs @@ -80,7 +80,7 @@ namespace Jellyfin.Server endpoints.MapControllers(); if (_serverConfigurationManager.Configuration.EnableMetrics) { - endpoints.MapMetrics(); + endpoints.MapMetrics(_serverConfigurationManager.Configuration.BaseUrl.TrimStart('/') + "/metrics"); } }); From b8d1419d9a09e86914fe0ab9e61ffadc7b7eb514 Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Sat, 1 Jun 2019 22:40:01 +0200 Subject: [PATCH 092/115] Add basic new data model. Added maxlength to SourceId text field in Metadata entity. Added extra fields to Person entity and adjusted SourceId length to 255. Added Extra Nuget deps for Relational databases and added Default Sqlite connection string. Made LibraryItem and Metadata abstract. Added artwork, changed DbSet names, added Seasons, added Genres, removed Language enum Add MediaFIleKind, add CustomVideos, add Books. Add AdditionalStream Updated GUIDs. Remove merge artifacts. Updated Language to use ISO-639-3 3 letter language codes. Added collections and concurrency tokens. Added chapters. Added Photos and renamed CustomVideo to CustomItem. Started adding fields. Added extra fields and Company entities. Implement a first pass of user permissions for the new database schema Upgrade to v2 of the addon. Commit generated files. Update comment, rename namespace and remove superflous field. Un-ignore any generated code. Clean up the model files and other left overs. --- Jellyfin.Data/DbContexts/Jellyfin.cs | 1140 ++++++++++++++++++ Jellyfin.Data/Entities/Artwork.cs | 208 ++++ Jellyfin.Data/Entities/Book.cs | 84 ++ Jellyfin.Data/Entities/BookMetadata.cs | 123 ++ Jellyfin.Data/Entities/Chapter.cs | 274 +++++ Jellyfin.Data/Entities/Collection.cs | 131 ++ Jellyfin.Data/Entities/CollectionItem.cs | 151 +++ Jellyfin.Data/Entities/Company.cs | 147 +++ Jellyfin.Data/Entities/CompanyMetadata.cs | 234 ++++ Jellyfin.Data/Entities/CustomItem.cs | 84 ++ Jellyfin.Data/Entities/CustomItemMetadata.cs | 86 ++ Jellyfin.Data/Entities/Episode.cs | 127 ++ Jellyfin.Data/Entities/EpisodeMetadata.cs | 197 +++ Jellyfin.Data/Entities/Genre.cs | 163 +++ Jellyfin.Data/Entities/Group.cs | 115 ++ Jellyfin.Data/Entities/Library.cs | 158 +++ Jellyfin.Data/Entities/LibraryItem.cs | 180 +++ Jellyfin.Data/Entities/LibraryRoot.cs | 202 ++++ Jellyfin.Data/Entities/MediaFile.cs | 209 ++++ Jellyfin.Data/Entities/MediaFileStream.cs | 160 +++ Jellyfin.Data/Entities/Metadata.cs | 385 ++++++ Jellyfin.Data/Entities/MetadataProvider.cs | 158 +++ Jellyfin.Data/Entities/MetadataProviderId.cs | 189 +++ Jellyfin.Data/Entities/Movie.cs | 84 ++ Jellyfin.Data/Entities/MovieMetadata.cs | 239 ++++ Jellyfin.Data/Entities/MusicAlbum.cs | 84 ++ Jellyfin.Data/Entities/MusicAlbumMetadata.cs | 202 ++++ Jellyfin.Data/Entities/Permission.cs | 152 +++ Jellyfin.Data/Entities/PermissionKind.cs | 40 + Jellyfin.Data/Entities/Person.cs | 312 +++++ Jellyfin.Data/Entities/PersonRole.cs | 215 ++++ Jellyfin.Data/Entities/Photo.cs | 84 ++ Jellyfin.Data/Entities/PhotoMetadata.cs | 86 ++ Jellyfin.Data/Entities/Preference.cs | 117 ++ Jellyfin.Data/Entities/PreferenceKind.cs | 27 + Jellyfin.Data/Entities/ProviderMapping.cs | 133 ++ Jellyfin.Data/Entities/Rating.cs | 197 +++ Jellyfin.Data/Entities/RatingSource.cs | 242 ++++ Jellyfin.Data/Entities/Release.cs | 197 +++ Jellyfin.Data/Entities/Season.cs | 127 ++ Jellyfin.Data/Entities/SeasonMetadata.cs | 123 ++ Jellyfin.Data/Entities/Series.cs | 183 +++ Jellyfin.Data/Entities/SeriesMetadata.cs | 239 ++++ Jellyfin.Data/Entities/Track.cs | 127 ++ Jellyfin.Data/Entities/TrackMetadata.cs | 86 ++ Jellyfin.Data/Entities/User.cs | 242 ++++ Jellyfin.Data/Enums/ArtKind.cs | 25 + Jellyfin.Data/Enums/MediaFileKind.cs | 25 + Jellyfin.Data/Enums/PersonRoleType.cs | 32 + Jellyfin.Data/Enums/Weekday.cs | 27 + Jellyfin.Data/Jellyfin.Data.csproj | 12 + Jellyfin.Data/Structs/.gitkeep | 0 MediaBrowser.sln | 19 +- 53 files changed, 8571 insertions(+), 12 deletions(-) create mode 100644 Jellyfin.Data/DbContexts/Jellyfin.cs create mode 100644 Jellyfin.Data/Entities/Artwork.cs create mode 100644 Jellyfin.Data/Entities/Book.cs create mode 100644 Jellyfin.Data/Entities/BookMetadata.cs create mode 100644 Jellyfin.Data/Entities/Chapter.cs create mode 100644 Jellyfin.Data/Entities/Collection.cs create mode 100644 Jellyfin.Data/Entities/CollectionItem.cs create mode 100644 Jellyfin.Data/Entities/Company.cs create mode 100644 Jellyfin.Data/Entities/CompanyMetadata.cs create mode 100644 Jellyfin.Data/Entities/CustomItem.cs create mode 100644 Jellyfin.Data/Entities/CustomItemMetadata.cs create mode 100644 Jellyfin.Data/Entities/Episode.cs create mode 100644 Jellyfin.Data/Entities/EpisodeMetadata.cs create mode 100644 Jellyfin.Data/Entities/Genre.cs create mode 100644 Jellyfin.Data/Entities/Group.cs create mode 100644 Jellyfin.Data/Entities/Library.cs create mode 100644 Jellyfin.Data/Entities/LibraryItem.cs create mode 100644 Jellyfin.Data/Entities/LibraryRoot.cs create mode 100644 Jellyfin.Data/Entities/MediaFile.cs create mode 100644 Jellyfin.Data/Entities/MediaFileStream.cs create mode 100644 Jellyfin.Data/Entities/Metadata.cs create mode 100644 Jellyfin.Data/Entities/MetadataProvider.cs create mode 100644 Jellyfin.Data/Entities/MetadataProviderId.cs create mode 100644 Jellyfin.Data/Entities/Movie.cs create mode 100644 Jellyfin.Data/Entities/MovieMetadata.cs create mode 100644 Jellyfin.Data/Entities/MusicAlbum.cs create mode 100644 Jellyfin.Data/Entities/MusicAlbumMetadata.cs create mode 100644 Jellyfin.Data/Entities/Permission.cs create mode 100644 Jellyfin.Data/Entities/PermissionKind.cs create mode 100644 Jellyfin.Data/Entities/Person.cs create mode 100644 Jellyfin.Data/Entities/PersonRole.cs create mode 100644 Jellyfin.Data/Entities/Photo.cs create mode 100644 Jellyfin.Data/Entities/PhotoMetadata.cs create mode 100644 Jellyfin.Data/Entities/Preference.cs create mode 100644 Jellyfin.Data/Entities/PreferenceKind.cs create mode 100644 Jellyfin.Data/Entities/ProviderMapping.cs create mode 100644 Jellyfin.Data/Entities/Rating.cs create mode 100644 Jellyfin.Data/Entities/RatingSource.cs create mode 100644 Jellyfin.Data/Entities/Release.cs create mode 100644 Jellyfin.Data/Entities/Season.cs create mode 100644 Jellyfin.Data/Entities/SeasonMetadata.cs create mode 100644 Jellyfin.Data/Entities/Series.cs create mode 100644 Jellyfin.Data/Entities/SeriesMetadata.cs create mode 100644 Jellyfin.Data/Entities/Track.cs create mode 100644 Jellyfin.Data/Entities/TrackMetadata.cs create mode 100644 Jellyfin.Data/Entities/User.cs create mode 100644 Jellyfin.Data/Enums/ArtKind.cs create mode 100644 Jellyfin.Data/Enums/MediaFileKind.cs create mode 100644 Jellyfin.Data/Enums/PersonRoleType.cs create mode 100644 Jellyfin.Data/Enums/Weekday.cs create mode 100644 Jellyfin.Data/Jellyfin.Data.csproj create mode 100644 Jellyfin.Data/Structs/.gitkeep diff --git a/Jellyfin.Data/DbContexts/Jellyfin.cs b/Jellyfin.Data/DbContexts/Jellyfin.cs new file mode 100644 index 0000000000..fd488ce7d7 --- /dev/null +++ b/Jellyfin.Data/DbContexts/Jellyfin.cs @@ -0,0 +1,1140 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; + +namespace Jellyfin.Data.DbContexts +{ + /// + public partial class Jellyfin : DbContext + { + #region DbSets + public virtual Microsoft.EntityFrameworkCore.DbSet Artwork { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Books { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet BookMetadata { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Chapters { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Collections { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet CollectionItems { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Companies { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet CompanyMetadata { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet CustomItems { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet CustomItemMetadata { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Episodes { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet EpisodeMetadata { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Genres { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Groups { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Libraries { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet LibraryItems { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet LibraryRoot { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet MediaFiles { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet MediaFileStream { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Metadata { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet MetadataProviders { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet MetadataProviderIds { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Movies { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet MovieMetadata { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet MusicAlbums { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet MusicAlbumMetadata { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Permissions { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet People { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet PersonRoles { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Photo { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet PhotoMetadata { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Preferences { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet ProviderMappings { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Ratings { get; set; } + + /// + /// Repository for global::Jellyfin.Data.Entities.RatingSource - This is the entity to + /// store review ratings, not age ratings + /// + public virtual Microsoft.EntityFrameworkCore.DbSet RatingSources { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Releases { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Seasons { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet SeasonMetadata { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Series { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet SeriesMetadata { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Tracks { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet TrackMetadata { get; set; } + public virtual Microsoft.EntityFrameworkCore.DbSet Users { get; set; } + #endregion DbSets + + /// + /// Default connection string + /// + public static string ConnectionString { get; set; } = @"Data Source=jellyfin.db"; + + /// + public Jellyfin(DbContextOptions options) : base(options) + { + } + + partial void CustomInit(DbContextOptionsBuilder optionsBuilder); + + /// + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + CustomInit(optionsBuilder); + } + + partial void OnModelCreatingImpl(ModelBuilder modelBuilder); + partial void OnModelCreatedImpl(ModelBuilder modelBuilder); + + /// + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + OnModelCreatingImpl(modelBuilder); + + modelBuilder.HasDefaultSchema("jellyfin"); + + modelBuilder.Entity() + .ToTable("Artwork") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Path) + .HasMaxLength(65535) + .IsRequired() + .HasField("_Path") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Kind) + .IsRequired() + .HasField("_Kind") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity().HasIndex(t => t.Kind); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + + modelBuilder.Entity() + .HasMany(x => x.BookMetadata) + .WithOne() + .HasForeignKey("BookMetadata_BookMetadata_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.Releases) + .WithOne() + .HasForeignKey("Release_Releases_Id") + .IsRequired(); + + modelBuilder.Entity() + .Property(t => t.ISBN) + .HasField("_ISBN") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .HasMany(x => x.Publishers) + .WithOne() + .HasForeignKey("Company_Publishers_Id") + .IsRequired(); + + modelBuilder.Entity() + .ToTable("Chapter") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Name) + .HasMaxLength(1024) + .HasField("_Name") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Language) + .HasMaxLength(3) + .IsRequired() + .HasField("_Language") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.TimeStart) + .IsRequired() + .HasField("_TimeStart") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.TimeEnd) + .HasField("_TimeEnd") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + + modelBuilder.Entity() + .ToTable("Collection") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Name) + .HasMaxLength(1024) + .HasField("_Name") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + modelBuilder.Entity() + .HasMany(x => x.CollectionItem) + .WithOne() + .HasForeignKey("CollectionItem_CollectionItem_Id") + .IsRequired(); + + modelBuilder.Entity() + .ToTable("CollectionItem") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + modelBuilder.Entity() + .HasOne(x => x.LibraryItem) + .WithOne() + .HasForeignKey("LibraryItem_Id") + .IsRequired(); + modelBuilder.Entity() + .HasOne(x => x.Next) + .WithOne() + .HasForeignKey("CollectionItem_Next_Id") + .IsRequired(); + modelBuilder.Entity() + .HasOne(x => x.Previous) + .WithOne() + .HasForeignKey("CollectionItem_Previous_Id") + .IsRequired(); + + modelBuilder.Entity() + .ToTable("Company") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + modelBuilder.Entity() + .HasMany(x => x.CompanyMetadata) + .WithOne() + .HasForeignKey("CompanyMetadata_CompanyMetadata_Id") + .IsRequired(); + modelBuilder.Entity() + .HasOne(x => x.Parent) + .WithOne() + .HasForeignKey("Company_Parent_Id") + .IsRequired(); + + modelBuilder.Entity() + .Property(t => t.Description) + .HasMaxLength(65535) + .HasField("_Description") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Headquarters) + .HasMaxLength(255) + .HasField("_Headquarters") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Country) + .HasMaxLength(2) + .HasField("_Country") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Homepage) + .HasMaxLength(1024) + .HasField("_Homepage") + .UsePropertyAccessMode(PropertyAccessMode.Property); + + modelBuilder.Entity() + .HasMany(x => x.CustomItemMetadata) + .WithOne() + .HasForeignKey("CustomItemMetadata_CustomItemMetadata_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.Releases) + .WithOne() + .HasForeignKey("Release_Releases_Id") + .IsRequired(); + + + modelBuilder.Entity() + .Property(t => t.EpisodeNumber) + .HasField("_EpisodeNumber") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .HasMany(x => x.Releases) + .WithOne() + .HasForeignKey("Release_Releases_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.EpisodeMetadata) + .WithOne() + .HasForeignKey("EpisodeMetadata_EpisodeMetadata_Id") + .IsRequired(); + + modelBuilder.Entity() + .Property(t => t.Outline) + .HasMaxLength(1024) + .HasField("_Outline") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Plot) + .HasMaxLength(65535) + .HasField("_Plot") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Tagline) + .HasMaxLength(1024) + .HasField("_Tagline") + .UsePropertyAccessMode(PropertyAccessMode.Property); + + modelBuilder.Entity() + .ToTable("Genre") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Name) + .HasMaxLength(255) + .IsRequired() + .HasField("_Name") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity().HasIndex(t => t.Name) + .IsUnique(); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + + modelBuilder.Entity() + .ToTable("Groups") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Name) + .HasMaxLength(255) + .IsRequired(); + modelBuilder.Entity().Property("Timestamp").IsConcurrencyToken(); + modelBuilder.Entity() + .HasMany(x => x.GroupPermissions) + .WithOne() + .HasForeignKey("Permission_GroupPermissions_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.ProviderMappings) + .WithOne() + .HasForeignKey("ProviderMapping_ProviderMappings_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.Preferences) + .WithOne() + .HasForeignKey("Preference_Preferences_Id") + .IsRequired(); + + modelBuilder.Entity() + .ToTable("Library") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Name) + .HasMaxLength(1024) + .IsRequired() + .HasField("_Name") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + + modelBuilder.Entity() + .ToTable("LibraryItem") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.UrlId) + .IsRequired() + .HasField("_UrlId") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity().HasIndex(t => t.UrlId) + .IsUnique(); + modelBuilder.Entity() + .Property(t => t.DateAdded) + .IsRequired() + .HasField("_DateAdded") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + modelBuilder.Entity() + .HasOne(x => x.LibraryRoot) + .WithOne() + .HasForeignKey("LibraryRoot_Id") + .IsRequired(); + + modelBuilder.Entity() + .ToTable("LibraryRoot") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Path) + .HasMaxLength(65535) + .IsRequired() + .HasField("_Path") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.NetworkPath) + .HasMaxLength(65535) + .HasField("_NetworkPath") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + modelBuilder.Entity() + .HasOne(x => x.Library) + .WithOne() + .HasForeignKey("Library_Id") + .IsRequired(); + + modelBuilder.Entity() + .ToTable("MediaFile") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Path) + .HasMaxLength(65535) + .IsRequired() + .HasField("_Path") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Kind) + .IsRequired() + .HasField("_Kind") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + modelBuilder.Entity() + .HasMany(x => x.MediaFileStreams) + .WithOne() + .HasForeignKey("MediaFileStream_MediaFileStreams_Id") + .IsRequired(); + + modelBuilder.Entity() + .ToTable("MediaFileStream") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.StreamNumber) + .IsRequired() + .HasField("_StreamNumber") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + + modelBuilder.Entity() + .ToTable("Metadata") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Title) + .HasMaxLength(1024) + .IsRequired() + .HasField("_Title") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.OriginalTitle) + .HasMaxLength(1024) + .HasField("_OriginalTitle") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.SortTitle) + .HasMaxLength(1024) + .HasField("_SortTitle") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Language) + .HasMaxLength(3) + .IsRequired() + .HasField("_Language") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.ReleaseDate) + .HasField("_ReleaseDate") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.DateAdded) + .IsRequired() + .HasField("_DateAdded") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.DateModified) + .IsRequired() + .HasField("_DateModified") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + modelBuilder.Entity() + .HasMany(x => x.PersonRoles) + .WithOne() + .HasForeignKey("PersonRole_PersonRoles_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.Genres) + .WithOne() + .HasForeignKey("Genre_Genres_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.Artwork) + .WithOne() + .HasForeignKey("Artwork_Artwork_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.Ratings) + .WithOne() + .HasForeignKey("Rating_Ratings_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.Sources) + .WithOne() + .HasForeignKey("MetadataProviderId_Sources_Id") + .IsRequired(); + + modelBuilder.Entity() + .ToTable("MetadataProvider") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Name) + .HasMaxLength(1024) + .IsRequired() + .HasField("_Name") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + + modelBuilder.Entity() + .ToTable("MetadataProviderId") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.ProviderId) + .HasMaxLength(255) + .IsRequired() + .HasField("_ProviderId") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + modelBuilder.Entity() + .HasOne(x => x.MetadataProvider) + .WithOne() + .HasForeignKey("MetadataProvider_Id") + .IsRequired(); + + modelBuilder.Entity() + .HasMany(x => x.Releases) + .WithOne() + .HasForeignKey("Release_Releases_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.MovieMetadata) + .WithOne() + .HasForeignKey("MovieMetadata_MovieMetadata_Id") + .IsRequired(); + + modelBuilder.Entity() + .Property(t => t.Outline) + .HasMaxLength(1024) + .HasField("_Outline") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Plot) + .HasMaxLength(65535) + .HasField("_Plot") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Tagline) + .HasMaxLength(1024) + .HasField("_Tagline") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Country) + .HasMaxLength(2) + .HasField("_Country") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .HasMany(x => x.Studios) + .WithOne() + .HasForeignKey("Company_Studios_Id") + .IsRequired(); + + modelBuilder.Entity() + .HasMany(x => x.MusicAlbumMetadata) + .WithOne() + .HasForeignKey("MusicAlbumMetadata_MusicAlbumMetadata_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.Tracks) + .WithOne() + .HasForeignKey("Track_Tracks_Id") + .IsRequired(); + + modelBuilder.Entity() + .Property(t => t.Barcode) + .HasMaxLength(255) + .HasField("_Barcode") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.LabelNumber) + .HasMaxLength(255) + .HasField("_LabelNumber") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Country) + .HasMaxLength(2) + .HasField("_Country") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .HasMany(x => x.Labels) + .WithOne() + .HasForeignKey("Company_Labels_Id") + .IsRequired(); + + modelBuilder.Entity() + .ToTable("Permissions") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Kind) + .IsRequired() + .HasField("_Kind") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Value) + .IsRequired(); + modelBuilder.Entity().Property("Timestamp").IsConcurrencyToken(); + + modelBuilder.Entity() + .ToTable("Person") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.UrlId) + .IsRequired() + .HasField("_UrlId") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Name) + .HasMaxLength(1024) + .IsRequired() + .HasField("_Name") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.SourceId) + .HasMaxLength(255) + .HasField("_SourceId") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.DateAdded) + .IsRequired() + .HasField("_DateAdded") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.DateModified) + .IsRequired() + .HasField("_DateModified") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + modelBuilder.Entity() + .HasMany(x => x.Sources) + .WithOne() + .HasForeignKey("MetadataProviderId_Sources_Id") + .IsRequired(); + + modelBuilder.Entity() + .ToTable("PersonRole") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Role) + .HasMaxLength(1024) + .HasField("_Role") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Type) + .IsRequired() + .HasField("_Type") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + modelBuilder.Entity() + .HasOne(x => x.Person) + .WithOne() + .HasForeignKey("Person_Id") + .IsRequired() + .OnDelete(DeleteBehavior.Cascade); + modelBuilder.Entity() + .HasOne(x => x.Artwork) + .WithOne() + .HasForeignKey("Artwork_Artwork_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.Sources) + .WithOne() + .HasForeignKey("MetadataProviderId_Sources_Id") + .IsRequired(); + + modelBuilder.Entity() + .HasMany(x => x.PhotoMetadata) + .WithOne() + .HasForeignKey("PhotoMetadata_PhotoMetadata_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.Releases) + .WithOne() + .HasForeignKey("Release_Releases_Id") + .IsRequired(); + + + modelBuilder.Entity() + .ToTable("Preferences") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Kind) + .IsRequired(); + modelBuilder.Entity() + .Property(t => t.Value) + .HasMaxLength(65535) + .IsRequired(); + modelBuilder.Entity().Property("Timestamp").IsConcurrencyToken(); + + modelBuilder.Entity() + .ToTable("ProviderMappings") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.ProviderName) + .HasMaxLength(255) + .IsRequired(); + modelBuilder.Entity() + .Property(t => t.ProviderSecrets) + .HasMaxLength(65535) + .IsRequired(); + modelBuilder.Entity() + .Property(t => t.ProviderData) + .HasMaxLength(65535) + .IsRequired(); + modelBuilder.Entity().Property("Timestamp").IsConcurrencyToken(); + + modelBuilder.Entity() + .ToTable("Rating") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Value) + .IsRequired() + .HasField("_Value") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Votes) + .HasField("_Votes") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + modelBuilder.Entity() + .HasOne(x => x.RatingType) + .WithOne() + .HasForeignKey("RatingSource_RatingType_Id") + .IsRequired(); + + modelBuilder.Entity() + .ToTable("RatingType") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Name) + .HasMaxLength(1024) + .HasField("_Name") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.MaximumValue) + .IsRequired() + .HasField("_MaximumValue") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.MinimumValue) + .IsRequired() + .HasField("_MinimumValue") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + modelBuilder.Entity() + .HasOne(x => x.Source) + .WithOne() + .HasForeignKey("MetadataProviderId_Source_Id") + .IsRequired(); + + modelBuilder.Entity() + .ToTable("Release") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .HasField("_Id") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.Name) + .HasMaxLength(1024) + .IsRequired() + .HasField("_Name") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Timestamp) + .IsRequired() + .HasField("_Timestamp") + .UsePropertyAccessMode(PropertyAccessMode.Property) + .IsRowVersion(); + modelBuilder.Entity() + .HasMany(x => x.MediaFiles) + .WithOne() + .HasForeignKey("MediaFile_MediaFiles_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.Chapters) + .WithOne() + .HasForeignKey("Chapter_Chapters_Id") + .IsRequired(); + + modelBuilder.Entity() + .Property(t => t.SeasonNumber) + .HasField("_SeasonNumber") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .HasMany(x => x.SeasonMetadata) + .WithOne() + .HasForeignKey("SeasonMetadata_SeasonMetadata_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.Episodes) + .WithOne() + .HasForeignKey("Episode_Episodes_Id") + .IsRequired(); + + modelBuilder.Entity() + .Property(t => t.Outline) + .HasMaxLength(1024) + .HasField("_Outline") + .UsePropertyAccessMode(PropertyAccessMode.Property); + + modelBuilder.Entity() + .Property(t => t.AirsDayOfWeek) + .HasField("_AirsDayOfWeek") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.AirsTime) + .HasField("_AirsTime") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.FirstAired) + .HasField("_FirstAired") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .HasMany(x => x.SeriesMetadata) + .WithOne() + .HasForeignKey("SeriesMetadata_SeriesMetadata_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.Seasons) + .WithOne() + .HasForeignKey("Season_Seasons_Id") + .IsRequired(); + + modelBuilder.Entity() + .Property(t => t.Outline) + .HasMaxLength(1024) + .HasField("_Outline") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Plot) + .HasMaxLength(65535) + .HasField("_Plot") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Tagline) + .HasMaxLength(1024) + .HasField("_Tagline") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .Property(t => t.Country) + .HasMaxLength(2) + .HasField("_Country") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .HasMany(x => x.Networks) + .WithOne() + .HasForeignKey("Company_Networks_Id") + .IsRequired(); + + modelBuilder.Entity() + .Property(t => t.TrackNumber) + .HasField("_TrackNumber") + .UsePropertyAccessMode(PropertyAccessMode.Property); + modelBuilder.Entity() + .HasMany(x => x.Releases) + .WithOne() + .HasForeignKey("Release_Releases_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.TrackMetadata) + .WithOne() + .HasForeignKey("TrackMetadata_TrackMetadata_Id") + .IsRequired(); + + + modelBuilder.Entity() + .ToTable("Users") + .HasKey(t => t.Id); + modelBuilder.Entity() + .Property(t => t.Id) + .IsRequired() + .ValueGeneratedOnAdd(); + modelBuilder.Entity() + .Property(t => t.LastLoginTimestamp) + .IsRequired() + .IsRowVersion(); + modelBuilder.Entity() + .Property(t => t.Username) + .HasMaxLength(255) + .IsRequired(); + modelBuilder.Entity() + .Property(t => t.Password) + .HasMaxLength(65535); + modelBuilder.Entity() + .Property(t => t.MustUpdatePassword) + .IsRequired(); + modelBuilder.Entity() + .Property(t => t.AudioLanguagePreference) + .HasMaxLength(255) + .IsRequired(); + modelBuilder.Entity() + .Property(t => t.AuthenticationProviderId) + .HasMaxLength(255) + .IsRequired(); + modelBuilder.Entity() + .Property(t => t.GroupedFolders) + .HasMaxLength(65535); + modelBuilder.Entity() + .Property(t => t.InvalidLoginAttemptCount) + .IsRequired(); + modelBuilder.Entity() + .Property(t => t.LatestItemExcludes) + .HasMaxLength(65535); + modelBuilder.Entity() + .Property(t => t.MyMediaExcludes) + .HasMaxLength(65535); + modelBuilder.Entity() + .Property(t => t.OrderedViews) + .HasMaxLength(65535); + modelBuilder.Entity() + .Property(t => t.SubtitleMode) + .HasMaxLength(255) + .IsRequired(); + modelBuilder.Entity() + .Property(t => t.PlayDefaultAudioTrack) + .IsRequired(); + modelBuilder.Entity() + .Property(t => t.SubtitleLanguagePrefernce) + .HasMaxLength(255); + modelBuilder.Entity() + .HasMany(x => x.Groups) + .WithOne() + .HasForeignKey("Group_Groups_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.Permissions) + .WithOne() + .HasForeignKey("Permission_Permissions_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.ProviderMappings) + .WithOne() + .HasForeignKey("ProviderMapping_ProviderMappings_Id") + .IsRequired(); + modelBuilder.Entity() + .HasMany(x => x.Preferences) + .WithOne() + .HasForeignKey("Preference_Preferences_Id") + .IsRequired(); + + OnModelCreatedImpl(modelBuilder); + } + } +} diff --git a/Jellyfin.Data/Entities/Artwork.cs b/Jellyfin.Data/Entities/Artwork.cs new file mode 100644 index 0000000000..be13686dc2 --- /dev/null +++ b/Jellyfin.Data/Entities/Artwork.cs @@ -0,0 +1,208 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Artwork + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Artwork() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Artwork CreateArtworkUnsafe() + { + return new Artwork(); + } + + /// + /// Public constructor with required data + /// + /// + /// + /// + /// + public Artwork(string path, global::Jellyfin.Data.Enums.ArtKind kind, global::Jellyfin.Data.Entities.Metadata _metadata0, global::Jellyfin.Data.Entities.PersonRole _personrole1) + { + if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path)); + this.Path = path; + + this.Kind = kind; + + if (_metadata0 == null) throw new ArgumentNullException(nameof(_metadata0)); + _metadata0.Artwork.Add(this); + + if (_personrole1 == null) throw new ArgumentNullException(nameof(_personrole1)); + _personrole1.Artwork = this; + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + /// + /// + public static Artwork Create(string path, global::Jellyfin.Data.Enums.ArtKind kind, global::Jellyfin.Data.Entities.Metadata _metadata0, global::Jellyfin.Data.Entities.PersonRole _personrole1) + { + return new Artwork(path, kind, _metadata0, _personrole1); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for Path + /// + protected string _Path; + /// + /// When provided in a partial class, allows value of Path to be changed before setting. + /// + partial void SetPath(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Path to be changed before returning. + /// + partial void GetPath(ref string result); + + /// + /// Required, Max length = 65535 + /// + [Required] + [MaxLength(65535)] + [StringLength(65535)] + public string Path + { + get + { + string value = _Path; + GetPath(ref value); + return (_Path = value); + } + set + { + string oldValue = _Path; + SetPath(oldValue, ref value); + if (oldValue != value) + { + _Path = value; + } + } + } + + /// + /// Backing field for Kind + /// + internal global::Jellyfin.Data.Enums.ArtKind _Kind; + /// + /// When provided in a partial class, allows value of Kind to be changed before setting. + /// + partial void SetKind(global::Jellyfin.Data.Enums.ArtKind oldValue, ref global::Jellyfin.Data.Enums.ArtKind newValue); + /// + /// When provided in a partial class, allows value of Kind to be changed before returning. + /// + partial void GetKind(ref global::Jellyfin.Data.Enums.ArtKind result); + + /// + /// Indexed, Required + /// + [Required] + public global::Jellyfin.Data.Enums.ArtKind Kind + { + get + { + global::Jellyfin.Data.Enums.ArtKind value = _Kind; + GetKind(ref value); + return (_Kind = value); + } + set + { + global::Jellyfin.Data.Enums.ArtKind oldValue = _Kind; + SetKind(oldValue, ref value); + if (oldValue != value) + { + _Kind = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + } +} + diff --git a/Jellyfin.Data/Entities/Book.cs b/Jellyfin.Data/Entities/Book.cs new file mode 100644 index 0000000000..30c89ae5c5 --- /dev/null +++ b/Jellyfin.Data/Entities/Book.cs @@ -0,0 +1,84 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Book: global::Jellyfin.Data.Entities.LibraryItem + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Book(): base() + { + BookMetadata = new System.Collections.Generic.HashSet(); + Releases = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Book CreateBookUnsafe() + { + return new Book(); + } + + /// + /// Public constructor with required data + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + public Book(Guid urlid, DateTime dateadded) + { + this.UrlId = urlid; + + this.BookMetadata = new System.Collections.Generic.HashSet(); + this.Releases = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + public static Book Create(Guid urlid, DateTime dateadded) + { + return new Book(urlid, dateadded); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection BookMetadata { get; protected set; } + + public virtual ICollection Releases { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/BookMetadata.cs b/Jellyfin.Data/Entities/BookMetadata.cs new file mode 100644 index 0000000000..3a28244d69 --- /dev/null +++ b/Jellyfin.Data/Entities/BookMetadata.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class BookMetadata: global::Jellyfin.Data.Entities.Metadata + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected BookMetadata(): base() + { + Publishers = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static BookMetadata CreateBookMetadataUnsafe() + { + return new BookMetadata(); + } + + /// + /// Public constructor with required data + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public BookMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Book _book0) + { + if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title)); + this.Title = title; + + if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language)); + this.Language = language; + + if (_book0 == null) throw new ArgumentNullException(nameof(_book0)); + _book0.BookMetadata.Add(this); + + this.Publishers = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public static BookMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Book _book0) + { + return new BookMetadata(title, language, dateadded, datemodified, _book0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for ISBN + /// + protected long? _ISBN; + /// + /// When provided in a partial class, allows value of ISBN to be changed before setting. + /// + partial void SetISBN(long? oldValue, ref long? newValue); + /// + /// When provided in a partial class, allows value of ISBN to be changed before returning. + /// + partial void GetISBN(ref long? result); + + public long? ISBN + { + get + { + long? value = _ISBN; + GetISBN(ref value); + return (_ISBN = value); + } + set + { + long? oldValue = _ISBN; + SetISBN(oldValue, ref value); + if (oldValue != value) + { + _ISBN = value; + } + } + } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection Publishers { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/Chapter.cs b/Jellyfin.Data/Entities/Chapter.cs new file mode 100644 index 0000000000..21a5dd73ee --- /dev/null +++ b/Jellyfin.Data/Entities/Chapter.cs @@ -0,0 +1,274 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Chapter + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Chapter() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Chapter CreateChapterUnsafe() + { + return new Chapter(); + } + + /// + /// Public constructor with required data + /// + /// ISO-639-3 3-character language codes + /// + /// + public Chapter(string language, long timestart, global::Jellyfin.Data.Entities.Release _release0) + { + if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language)); + this.Language = language; + + this.TimeStart = timestart; + + if (_release0 == null) throw new ArgumentNullException(nameof(_release0)); + _release0.Chapters.Add(this); + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// ISO-639-3 3-character language codes + /// + /// + public static Chapter Create(string language, long timestart, global::Jellyfin.Data.Entities.Release _release0) + { + return new Chapter(language, timestart, _release0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for Name + /// + protected string _Name; + /// + /// When provided in a partial class, allows value of Name to be changed before setting. + /// + partial void SetName(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Name to be changed before returning. + /// + partial void GetName(ref string result); + + /// + /// Max length = 1024 + /// + [MaxLength(1024)] + [StringLength(1024)] + public string Name + { + get + { + string value = _Name; + GetName(ref value); + return (_Name = value); + } + set + { + string oldValue = _Name; + SetName(oldValue, ref value); + if (oldValue != value) + { + _Name = value; + } + } + } + + /// + /// Backing field for Language + /// + protected string _Language; + /// + /// When provided in a partial class, allows value of Language to be changed before setting. + /// + partial void SetLanguage(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Language to be changed before returning. + /// + partial void GetLanguage(ref string result); + + /// + /// Required, Min length = 3, Max length = 3 + /// ISO-639-3 3-character language codes + /// + [Required] + [MinLength(3)] + [MaxLength(3)] + [StringLength(3)] + public string Language + { + get + { + string value = _Language; + GetLanguage(ref value); + return (_Language = value); + } + set + { + string oldValue = _Language; + SetLanguage(oldValue, ref value); + if (oldValue != value) + { + _Language = value; + } + } + } + + /// + /// Backing field for TimeStart + /// + protected long _TimeStart; + /// + /// When provided in a partial class, allows value of TimeStart to be changed before setting. + /// + partial void SetTimeStart(long oldValue, ref long newValue); + /// + /// When provided in a partial class, allows value of TimeStart to be changed before returning. + /// + partial void GetTimeStart(ref long result); + + /// + /// Required + /// + [Required] + public long TimeStart + { + get + { + long value = _TimeStart; + GetTimeStart(ref value); + return (_TimeStart = value); + } + set + { + long oldValue = _TimeStart; + SetTimeStart(oldValue, ref value); + if (oldValue != value) + { + _TimeStart = value; + } + } + } + + /// + /// Backing field for TimeEnd + /// + protected long? _TimeEnd; + /// + /// When provided in a partial class, allows value of TimeEnd to be changed before setting. + /// + partial void SetTimeEnd(long? oldValue, ref long? newValue); + /// + /// When provided in a partial class, allows value of TimeEnd to be changed before returning. + /// + partial void GetTimeEnd(ref long? result); + + public long? TimeEnd + { + get + { + long? value = _TimeEnd; + GetTimeEnd(ref value); + return (_TimeEnd = value); + } + set + { + long? oldValue = _TimeEnd; + SetTimeEnd(oldValue, ref value); + if (oldValue != value) + { + _TimeEnd = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + } +} + diff --git a/Jellyfin.Data/Entities/Collection.cs b/Jellyfin.Data/Entities/Collection.cs new file mode 100644 index 0000000000..68979eb2fe --- /dev/null +++ b/Jellyfin.Data/Entities/Collection.cs @@ -0,0 +1,131 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Collection + { + partial void Init(); + + /// + /// Default constructor + /// + public Collection() + { + CollectionItem = new System.Collections.Generic.LinkedList(); + + Init(); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for Name + /// + protected string _Name; + /// + /// When provided in a partial class, allows value of Name to be changed before setting. + /// + partial void SetName(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Name to be changed before returning. + /// + partial void GetName(ref string result); + + /// + /// Max length = 1024 + /// + [MaxLength(1024)] + [StringLength(1024)] + public string Name + { + get + { + string value = _Name; + GetName(ref value); + return (_Name = value); + } + set + { + string oldValue = _Name; + SetName(oldValue, ref value); + if (oldValue != value) + { + _Name = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection CollectionItem { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/CollectionItem.cs b/Jellyfin.Data/Entities/CollectionItem.cs new file mode 100644 index 0000000000..8e575e0a28 --- /dev/null +++ b/Jellyfin.Data/Entities/CollectionItem.cs @@ -0,0 +1,151 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class CollectionItem + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected CollectionItem() + { + // NOTE: This class has one-to-one associations with CollectionItem. + // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other. + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static CollectionItem CreateCollectionItemUnsafe() + { + return new CollectionItem(); + } + + /// + /// Public constructor with required data + /// + /// + /// + /// + public CollectionItem(global::Jellyfin.Data.Entities.Collection _collection0, global::Jellyfin.Data.Entities.CollectionItem _collectionitem1, global::Jellyfin.Data.Entities.CollectionItem _collectionitem2) + { + // NOTE: This class has one-to-one associations with CollectionItem. + // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other. + + if (_collection0 == null) throw new ArgumentNullException(nameof(_collection0)); + _collection0.CollectionItem.Add(this); + + if (_collectionitem1 == null) throw new ArgumentNullException(nameof(_collectionitem1)); + _collectionitem1.Next = this; + + if (_collectionitem2 == null) throw new ArgumentNullException(nameof(_collectionitem2)); + _collectionitem2.Previous = this; + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + /// + public static CollectionItem Create(global::Jellyfin.Data.Entities.Collection _collection0, global::Jellyfin.Data.Entities.CollectionItem _collectionitem1, global::Jellyfin.Data.Entities.CollectionItem _collectionitem2) + { + return new CollectionItem(_collection0, _collectionitem1, _collectionitem2); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + /// + /// Required + /// + public virtual global::Jellyfin.Data.Entities.LibraryItem LibraryItem { get; set; } + + /// + /// TODO check if this properly updated dependant and has the proper principal relationship + /// + public virtual global::Jellyfin.Data.Entities.CollectionItem Next { get; set; } + + /// + /// TODO check if this properly updated dependant and has the proper principal relationship + /// + public virtual global::Jellyfin.Data.Entities.CollectionItem Previous { get; set; } + + } +} + diff --git a/Jellyfin.Data/Entities/Company.cs b/Jellyfin.Data/Entities/Company.cs new file mode 100644 index 0000000000..444ae9c564 --- /dev/null +++ b/Jellyfin.Data/Entities/Company.cs @@ -0,0 +1,147 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Company + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Company() + { + CompanyMetadata = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Company CreateCompanyUnsafe() + { + return new Company(); + } + + /// + /// Public constructor with required data + /// + /// + /// + /// + /// + /// + public Company(global::Jellyfin.Data.Entities.MovieMetadata _moviemetadata0, global::Jellyfin.Data.Entities.SeriesMetadata _seriesmetadata1, global::Jellyfin.Data.Entities.MusicAlbumMetadata _musicalbummetadata2, global::Jellyfin.Data.Entities.BookMetadata _bookmetadata3, global::Jellyfin.Data.Entities.Company _company4) + { + if (_moviemetadata0 == null) throw new ArgumentNullException(nameof(_moviemetadata0)); + _moviemetadata0.Studios.Add(this); + + if (_seriesmetadata1 == null) throw new ArgumentNullException(nameof(_seriesmetadata1)); + _seriesmetadata1.Networks.Add(this); + + if (_musicalbummetadata2 == null) throw new ArgumentNullException(nameof(_musicalbummetadata2)); + _musicalbummetadata2.Labels.Add(this); + + if (_bookmetadata3 == null) throw new ArgumentNullException(nameof(_bookmetadata3)); + _bookmetadata3.Publishers.Add(this); + + if (_company4 == null) throw new ArgumentNullException(nameof(_company4)); + _company4.Parent = this; + + this.CompanyMetadata = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + /// + /// + /// + public static Company Create(global::Jellyfin.Data.Entities.MovieMetadata _moviemetadata0, global::Jellyfin.Data.Entities.SeriesMetadata _seriesmetadata1, global::Jellyfin.Data.Entities.MusicAlbumMetadata _musicalbummetadata2, global::Jellyfin.Data.Entities.BookMetadata _bookmetadata3, global::Jellyfin.Data.Entities.Company _company4) + { + return new Company(_moviemetadata0, _seriesmetadata1, _musicalbummetadata2, _bookmetadata3, _company4); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection CompanyMetadata { get; protected set; } + + public virtual global::Jellyfin.Data.Entities.Company Parent { get; set; } + + } +} + diff --git a/Jellyfin.Data/Entities/CompanyMetadata.cs b/Jellyfin.Data/Entities/CompanyMetadata.cs new file mode 100644 index 0000000000..6d636e8846 --- /dev/null +++ b/Jellyfin.Data/Entities/CompanyMetadata.cs @@ -0,0 +1,234 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class CompanyMetadata: global::Jellyfin.Data.Entities.Metadata + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected CompanyMetadata(): base() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static CompanyMetadata CreateCompanyMetadataUnsafe() + { + return new CompanyMetadata(); + } + + /// + /// Public constructor with required data + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public CompanyMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Company _company0) + { + if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title)); + this.Title = title; + + if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language)); + this.Language = language; + + if (_company0 == null) throw new ArgumentNullException(nameof(_company0)); + _company0.CompanyMetadata.Add(this); + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public static CompanyMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Company _company0) + { + return new CompanyMetadata(title, language, dateadded, datemodified, _company0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Description + /// + protected string _Description; + /// + /// When provided in a partial class, allows value of Description to be changed before setting. + /// + partial void SetDescription(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Description to be changed before returning. + /// + partial void GetDescription(ref string result); + + /// + /// Max length = 65535 + /// + [MaxLength(65535)] + [StringLength(65535)] + public string Description + { + get + { + string value = _Description; + GetDescription(ref value); + return (_Description = value); + } + set + { + string oldValue = _Description; + SetDescription(oldValue, ref value); + if (oldValue != value) + { + _Description = value; + } + } + } + + /// + /// Backing field for Headquarters + /// + protected string _Headquarters; + /// + /// When provided in a partial class, allows value of Headquarters to be changed before setting. + /// + partial void SetHeadquarters(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Headquarters to be changed before returning. + /// + partial void GetHeadquarters(ref string result); + + /// + /// Max length = 255 + /// + [MaxLength(255)] + [StringLength(255)] + public string Headquarters + { + get + { + string value = _Headquarters; + GetHeadquarters(ref value); + return (_Headquarters = value); + } + set + { + string oldValue = _Headquarters; + SetHeadquarters(oldValue, ref value); + if (oldValue != value) + { + _Headquarters = value; + } + } + } + + /// + /// Backing field for Country + /// + protected string _Country; + /// + /// When provided in a partial class, allows value of Country to be changed before setting. + /// + partial void SetCountry(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Country to be changed before returning. + /// + partial void GetCountry(ref string result); + + /// + /// Max length = 2 + /// + [MaxLength(2)] + [StringLength(2)] + public string Country + { + get + { + string value = _Country; + GetCountry(ref value); + return (_Country = value); + } + set + { + string oldValue = _Country; + SetCountry(oldValue, ref value); + if (oldValue != value) + { + _Country = value; + } + } + } + + /// + /// Backing field for Homepage + /// + protected string _Homepage; + /// + /// When provided in a partial class, allows value of Homepage to be changed before setting. + /// + partial void SetHomepage(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Homepage to be changed before returning. + /// + partial void GetHomepage(ref string result); + + /// + /// Max length = 1024 + /// + [MaxLength(1024)] + [StringLength(1024)] + public string Homepage + { + get + { + string value = _Homepage; + GetHomepage(ref value); + return (_Homepage = value); + } + set + { + string oldValue = _Homepage; + SetHomepage(oldValue, ref value); + if (oldValue != value) + { + _Homepage = value; + } + } + } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + } +} + diff --git a/Jellyfin.Data/Entities/CustomItem.cs b/Jellyfin.Data/Entities/CustomItem.cs new file mode 100644 index 0000000000..eb6d2752d3 --- /dev/null +++ b/Jellyfin.Data/Entities/CustomItem.cs @@ -0,0 +1,84 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class CustomItem: global::Jellyfin.Data.Entities.LibraryItem + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected CustomItem(): base() + { + CustomItemMetadata = new System.Collections.Generic.HashSet(); + Releases = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static CustomItem CreateCustomItemUnsafe() + { + return new CustomItem(); + } + + /// + /// Public constructor with required data + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + public CustomItem(Guid urlid, DateTime dateadded) + { + this.UrlId = urlid; + + this.CustomItemMetadata = new System.Collections.Generic.HashSet(); + this.Releases = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + public static CustomItem Create(Guid urlid, DateTime dateadded) + { + return new CustomItem(urlid, dateadded); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection CustomItemMetadata { get; protected set; } + + public virtual ICollection Releases { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/CustomItemMetadata.cs b/Jellyfin.Data/Entities/CustomItemMetadata.cs new file mode 100644 index 0000000000..f2c15d3fe3 --- /dev/null +++ b/Jellyfin.Data/Entities/CustomItemMetadata.cs @@ -0,0 +1,86 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class CustomItemMetadata: global::Jellyfin.Data.Entities.Metadata + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected CustomItemMetadata(): base() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static CustomItemMetadata CreateCustomItemMetadataUnsafe() + { + return new CustomItemMetadata(); + } + + /// + /// Public constructor with required data + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public CustomItemMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.CustomItem _customitem0) + { + if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title)); + this.Title = title; + + if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language)); + this.Language = language; + + if (_customitem0 == null) throw new ArgumentNullException(nameof(_customitem0)); + _customitem0.CustomItemMetadata.Add(this); + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public static CustomItemMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.CustomItem _customitem0) + { + return new CustomItemMetadata(title, language, dateadded, datemodified, _customitem0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + } +} + diff --git a/Jellyfin.Data/Entities/Episode.cs b/Jellyfin.Data/Entities/Episode.cs new file mode 100644 index 0000000000..3a23f0976f --- /dev/null +++ b/Jellyfin.Data/Entities/Episode.cs @@ -0,0 +1,127 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Episode: global::Jellyfin.Data.Entities.LibraryItem + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Episode(): base() + { + // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem. + // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other. + + Releases = new System.Collections.Generic.HashSet(); + EpisodeMetadata = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Episode CreateEpisodeUnsafe() + { + return new Episode(); + } + + /// + /// Public constructor with required data + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + /// + public Episode(Guid urlid, DateTime dateadded, global::Jellyfin.Data.Entities.Season _season0) + { + // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem. + // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other. + + this.UrlId = urlid; + + if (_season0 == null) throw new ArgumentNullException(nameof(_season0)); + _season0.Episodes.Add(this); + + this.Releases = new System.Collections.Generic.HashSet(); + this.EpisodeMetadata = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + /// + public static Episode Create(Guid urlid, DateTime dateadded, global::Jellyfin.Data.Entities.Season _season0) + { + return new Episode(urlid, dateadded, _season0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for EpisodeNumber + /// + protected int? _EpisodeNumber; + /// + /// When provided in a partial class, allows value of EpisodeNumber to be changed before setting. + /// + partial void SetEpisodeNumber(int? oldValue, ref int? newValue); + /// + /// When provided in a partial class, allows value of EpisodeNumber to be changed before returning. + /// + partial void GetEpisodeNumber(ref int? result); + + public int? EpisodeNumber + { + get + { + int? value = _EpisodeNumber; + GetEpisodeNumber(ref value); + return (_EpisodeNumber = value); + } + set + { + int? oldValue = _EpisodeNumber; + SetEpisodeNumber(oldValue, ref value); + if (oldValue != value) + { + _EpisodeNumber = value; + } + } + } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection Releases { get; protected set; } + + public virtual ICollection EpisodeMetadata { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/EpisodeMetadata.cs b/Jellyfin.Data/Entities/EpisodeMetadata.cs new file mode 100644 index 0000000000..963219140d --- /dev/null +++ b/Jellyfin.Data/Entities/EpisodeMetadata.cs @@ -0,0 +1,197 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class EpisodeMetadata: global::Jellyfin.Data.Entities.Metadata + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected EpisodeMetadata(): base() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static EpisodeMetadata CreateEpisodeMetadataUnsafe() + { + return new EpisodeMetadata(); + } + + /// + /// Public constructor with required data + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public EpisodeMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Episode _episode0) + { + if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title)); + this.Title = title; + + if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language)); + this.Language = language; + + if (_episode0 == null) throw new ArgumentNullException(nameof(_episode0)); + _episode0.EpisodeMetadata.Add(this); + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public static EpisodeMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Episode _episode0) + { + return new EpisodeMetadata(title, language, dateadded, datemodified, _episode0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Outline + /// + protected string _Outline; + /// + /// When provided in a partial class, allows value of Outline to be changed before setting. + /// + partial void SetOutline(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Outline to be changed before returning. + /// + partial void GetOutline(ref string result); + + /// + /// Max length = 1024 + /// + [MaxLength(1024)] + [StringLength(1024)] + public string Outline + { + get + { + string value = _Outline; + GetOutline(ref value); + return (_Outline = value); + } + set + { + string oldValue = _Outline; + SetOutline(oldValue, ref value); + if (oldValue != value) + { + _Outline = value; + } + } + } + + /// + /// Backing field for Plot + /// + protected string _Plot; + /// + /// When provided in a partial class, allows value of Plot to be changed before setting. + /// + partial void SetPlot(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Plot to be changed before returning. + /// + partial void GetPlot(ref string result); + + /// + /// Max length = 65535 + /// + [MaxLength(65535)] + [StringLength(65535)] + public string Plot + { + get + { + string value = _Plot; + GetPlot(ref value); + return (_Plot = value); + } + set + { + string oldValue = _Plot; + SetPlot(oldValue, ref value); + if (oldValue != value) + { + _Plot = value; + } + } + } + + /// + /// Backing field for Tagline + /// + protected string _Tagline; + /// + /// When provided in a partial class, allows value of Tagline to be changed before setting. + /// + partial void SetTagline(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Tagline to be changed before returning. + /// + partial void GetTagline(ref string result); + + /// + /// Max length = 1024 + /// + [MaxLength(1024)] + [StringLength(1024)] + public string Tagline + { + get + { + string value = _Tagline; + GetTagline(ref value); + return (_Tagline = value); + } + set + { + string oldValue = _Tagline; + SetTagline(oldValue, ref value); + if (oldValue != value) + { + _Tagline = value; + } + } + } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + } +} + diff --git a/Jellyfin.Data/Entities/Genre.cs b/Jellyfin.Data/Entities/Genre.cs new file mode 100644 index 0000000000..982600553e --- /dev/null +++ b/Jellyfin.Data/Entities/Genre.cs @@ -0,0 +1,163 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Genre + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Genre() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Genre CreateGenreUnsafe() + { + return new Genre(); + } + + /// + /// Public constructor with required data + /// + /// + /// + public Genre(string name, global::Jellyfin.Data.Entities.Metadata _metadata0) + { + if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name)); + this.Name = name; + + if (_metadata0 == null) throw new ArgumentNullException(nameof(_metadata0)); + _metadata0.Genres.Add(this); + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + public static Genre Create(string name, global::Jellyfin.Data.Entities.Metadata _metadata0) + { + return new Genre(name, _metadata0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for Name + /// + internal string _Name; + /// + /// When provided in a partial class, allows value of Name to be changed before setting. + /// + partial void SetName(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Name to be changed before returning. + /// + partial void GetName(ref string result); + + /// + /// Indexed, Required, Max length = 255 + /// + [Required] + [MaxLength(255)] + [StringLength(255)] + public string Name + { + get + { + string value = _Name; + GetName(ref value); + return (_Name = value); + } + set + { + string oldValue = _Name; + SetName(oldValue, ref value); + if (oldValue != value) + { + _Name = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + } +} + diff --git a/Jellyfin.Data/Entities/Group.cs b/Jellyfin.Data/Entities/Group.cs new file mode 100644 index 0000000000..ff19e9b019 --- /dev/null +++ b/Jellyfin.Data/Entities/Group.cs @@ -0,0 +1,115 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Group + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Group() + { + GroupPermissions = new System.Collections.Generic.HashSet(); + ProviderMappings = new System.Collections.Generic.HashSet(); + Preferences = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Group CreateGroupUnsafe() + { + return new Group(); + } + + /// + /// Public constructor with required data + /// + /// + /// + public Group(string name, global::Jellyfin.Data.Entities.User _user0) + { + if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name)); + this.Name = name; + + if (_user0 == null) throw new ArgumentNullException(nameof(_user0)); + _user0.Groups.Add(this); + + this.GroupPermissions = new System.Collections.Generic.HashSet(); + this.ProviderMappings = new System.Collections.Generic.HashSet(); + this.Preferences = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + public static Group Create(string name, global::Jellyfin.Data.Entities.User _user0) + { + return new Group(name, _user0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id { get; protected set; } + + /// + /// Required, Max length = 255 + /// + [Required] + [MaxLength(255)] + [StringLength(255)] + public string Name { get; set; } + + /// + /// Concurrency token + /// + [Timestamp] + public Byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection GroupPermissions { get; protected set; } + + public virtual ICollection ProviderMappings { get; protected set; } + + public virtual ICollection Preferences { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/Library.cs b/Jellyfin.Data/Entities/Library.cs new file mode 100644 index 0000000000..19ca142947 --- /dev/null +++ b/Jellyfin.Data/Entities/Library.cs @@ -0,0 +1,158 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Library + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Library() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Library CreateLibraryUnsafe() + { + return new Library(); + } + + /// + /// Public constructor with required data + /// + /// + public Library(string name) + { + if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name)); + this.Name = name; + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + public static Library Create(string name) + { + return new Library(name); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for Name + /// + protected string _Name; + /// + /// When provided in a partial class, allows value of Name to be changed before setting. + /// + partial void SetName(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Name to be changed before returning. + /// + partial void GetName(ref string result); + + /// + /// Required, Max length = 1024 + /// + [Required] + [MaxLength(1024)] + [StringLength(1024)] + public string Name + { + get + { + string value = _Name; + GetName(ref value); + return (_Name = value); + } + set + { + string oldValue = _Name; + SetName(oldValue, ref value); + if (oldValue != value) + { + _Name = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + } +} + diff --git a/Jellyfin.Data/Entities/LibraryItem.cs b/Jellyfin.Data/Entities/LibraryItem.cs new file mode 100644 index 0000000000..1987196d69 --- /dev/null +++ b/Jellyfin.Data/Entities/LibraryItem.cs @@ -0,0 +1,180 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public abstract partial class LibraryItem + { + partial void Init(); + + /// + /// Default constructor. Protected due to being abstract. + /// + protected LibraryItem() + { + Init(); + } + + /// + /// Public constructor with required data + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + protected LibraryItem(Guid urlid, DateTime dateadded) + { + this.UrlId = urlid; + + + Init(); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for UrlId + /// + internal Guid _UrlId; + /// + /// When provided in a partial class, allows value of UrlId to be changed before setting. + /// + partial void SetUrlId(Guid oldValue, ref Guid newValue); + /// + /// When provided in a partial class, allows value of UrlId to be changed before returning. + /// + partial void GetUrlId(ref Guid result); + + /// + /// Indexed, Required + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + /// + [Required] + public Guid UrlId + { + get + { + Guid value = _UrlId; + GetUrlId(ref value); + return (_UrlId = value); + } + set + { + Guid oldValue = _UrlId; + SetUrlId(oldValue, ref value); + if (oldValue != value) + { + _UrlId = value; + } + } + } + + /// + /// Backing field for DateAdded + /// + protected DateTime _DateAdded; + /// + /// When provided in a partial class, allows value of DateAdded to be changed before setting. + /// + partial void SetDateAdded(DateTime oldValue, ref DateTime newValue); + /// + /// When provided in a partial class, allows value of DateAdded to be changed before returning. + /// + partial void GetDateAdded(ref DateTime result); + + /// + /// Required + /// + [Required] + public DateTime DateAdded + { + get + { + DateTime value = _DateAdded; + GetDateAdded(ref value); + return (_DateAdded = value); + } + internal set + { + DateTime oldValue = _DateAdded; + SetDateAdded(oldValue, ref value); + if (oldValue != value) + { + _DateAdded = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + /// + /// Required + /// + public virtual global::Jellyfin.Data.Entities.LibraryRoot LibraryRoot { get; set; } + + } +} + diff --git a/Jellyfin.Data/Entities/LibraryRoot.cs b/Jellyfin.Data/Entities/LibraryRoot.cs new file mode 100644 index 0000000000..015fc4ea98 --- /dev/null +++ b/Jellyfin.Data/Entities/LibraryRoot.cs @@ -0,0 +1,202 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class LibraryRoot + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected LibraryRoot() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static LibraryRoot CreateLibraryRootUnsafe() + { + return new LibraryRoot(); + } + + /// + /// Public constructor with required data + /// + /// Absolute Path + public LibraryRoot(string path) + { + if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path)); + this.Path = path; + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// Absolute Path + public static LibraryRoot Create(string path) + { + return new LibraryRoot(path); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for Path + /// + protected string _Path; + /// + /// When provided in a partial class, allows value of Path to be changed before setting. + /// + partial void SetPath(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Path to be changed before returning. + /// + partial void GetPath(ref string result); + + /// + /// Required, Max length = 65535 + /// Absolute Path + /// + [Required] + [MaxLength(65535)] + [StringLength(65535)] + public string Path + { + get + { + string value = _Path; + GetPath(ref value); + return (_Path = value); + } + set + { + string oldValue = _Path; + SetPath(oldValue, ref value); + if (oldValue != value) + { + _Path = value; + } + } + } + + /// + /// Backing field for NetworkPath + /// + protected string _NetworkPath; + /// + /// When provided in a partial class, allows value of NetworkPath to be changed before setting. + /// + partial void SetNetworkPath(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of NetworkPath to be changed before returning. + /// + partial void GetNetworkPath(ref string result); + + /// + /// Max length = 65535 + /// Absolute network path, for example for transcoding sattelites. + /// + [MaxLength(65535)] + [StringLength(65535)] + public string NetworkPath + { + get + { + string value = _NetworkPath; + GetNetworkPath(ref value); + return (_NetworkPath = value); + } + set + { + string oldValue = _NetworkPath; + SetNetworkPath(oldValue, ref value); + if (oldValue != value) + { + _NetworkPath = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + /// + /// Required + /// + public virtual global::Jellyfin.Data.Entities.Library Library { get; set; } + + } +} + diff --git a/Jellyfin.Data/Entities/MediaFile.cs b/Jellyfin.Data/Entities/MediaFile.cs new file mode 100644 index 0000000000..2a47a96325 --- /dev/null +++ b/Jellyfin.Data/Entities/MediaFile.cs @@ -0,0 +1,209 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class MediaFile + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected MediaFile() + { + MediaFileStreams = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static MediaFile CreateMediaFileUnsafe() + { + return new MediaFile(); + } + + /// + /// Public constructor with required data + /// + /// Relative to the LibraryRoot + /// + /// + public MediaFile(string path, global::Jellyfin.Data.Enums.MediaFileKind kind, global::Jellyfin.Data.Entities.Release _release0) + { + if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path)); + this.Path = path; + + this.Kind = kind; + + if (_release0 == null) throw new ArgumentNullException(nameof(_release0)); + _release0.MediaFiles.Add(this); + + this.MediaFileStreams = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// Relative to the LibraryRoot + /// + /// + public static MediaFile Create(string path, global::Jellyfin.Data.Enums.MediaFileKind kind, global::Jellyfin.Data.Entities.Release _release0) + { + return new MediaFile(path, kind, _release0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for Path + /// + protected string _Path; + /// + /// When provided in a partial class, allows value of Path to be changed before setting. + /// + partial void SetPath(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Path to be changed before returning. + /// + partial void GetPath(ref string result); + + /// + /// Required, Max length = 65535 + /// Relative to the LibraryRoot + /// + [Required] + [MaxLength(65535)] + [StringLength(65535)] + public string Path + { + get + { + string value = _Path; + GetPath(ref value); + return (_Path = value); + } + set + { + string oldValue = _Path; + SetPath(oldValue, ref value); + if (oldValue != value) + { + _Path = value; + } + } + } + + /// + /// Backing field for Kind + /// + protected global::Jellyfin.Data.Enums.MediaFileKind _Kind; + /// + /// When provided in a partial class, allows value of Kind to be changed before setting. + /// + partial void SetKind(global::Jellyfin.Data.Enums.MediaFileKind oldValue, ref global::Jellyfin.Data.Enums.MediaFileKind newValue); + /// + /// When provided in a partial class, allows value of Kind to be changed before returning. + /// + partial void GetKind(ref global::Jellyfin.Data.Enums.MediaFileKind result); + + /// + /// Required + /// + [Required] + public global::Jellyfin.Data.Enums.MediaFileKind Kind + { + get + { + global::Jellyfin.Data.Enums.MediaFileKind value = _Kind; + GetKind(ref value); + return (_Kind = value); + } + set + { + global::Jellyfin.Data.Enums.MediaFileKind oldValue = _Kind; + SetKind(oldValue, ref value); + if (oldValue != value) + { + _Kind = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection MediaFileStreams { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/MediaFileStream.cs b/Jellyfin.Data/Entities/MediaFileStream.cs new file mode 100644 index 0000000000..6593d3cf75 --- /dev/null +++ b/Jellyfin.Data/Entities/MediaFileStream.cs @@ -0,0 +1,160 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class MediaFileStream + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected MediaFileStream() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static MediaFileStream CreateMediaFileStreamUnsafe() + { + return new MediaFileStream(); + } + + /// + /// Public constructor with required data + /// + /// + /// + public MediaFileStream(int streamnumber, global::Jellyfin.Data.Entities.MediaFile _mediafile0) + { + this.StreamNumber = streamnumber; + + if (_mediafile0 == null) throw new ArgumentNullException(nameof(_mediafile0)); + _mediafile0.MediaFileStreams.Add(this); + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + public static MediaFileStream Create(int streamnumber, global::Jellyfin.Data.Entities.MediaFile _mediafile0) + { + return new MediaFileStream(streamnumber, _mediafile0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for StreamNumber + /// + protected int _StreamNumber; + /// + /// When provided in a partial class, allows value of StreamNumber to be changed before setting. + /// + partial void SetStreamNumber(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of StreamNumber to be changed before returning. + /// + partial void GetStreamNumber(ref int result); + + /// + /// Required + /// + [Required] + public int StreamNumber + { + get + { + int value = _StreamNumber; + GetStreamNumber(ref value); + return (_StreamNumber = value); + } + set + { + int oldValue = _StreamNumber; + SetStreamNumber(oldValue, ref value); + if (oldValue != value) + { + _StreamNumber = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + } +} + diff --git a/Jellyfin.Data/Entities/Metadata.cs b/Jellyfin.Data/Entities/Metadata.cs new file mode 100644 index 0000000000..6057017e94 --- /dev/null +++ b/Jellyfin.Data/Entities/Metadata.cs @@ -0,0 +1,385 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public abstract partial class Metadata + { + partial void Init(); + + /// + /// Default constructor. Protected due to being abstract. + /// + protected Metadata() + { + PersonRoles = new System.Collections.Generic.HashSet(); + Genres = new System.Collections.Generic.HashSet(); + Artwork = new System.Collections.Generic.HashSet(); + Ratings = new System.Collections.Generic.HashSet(); + Sources = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Public constructor with required data + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + protected Metadata(string title, string language, DateTime dateadded, DateTime datemodified) + { + if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title)); + this.Title = title; + + if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language)); + this.Language = language; + + this.PersonRoles = new System.Collections.Generic.HashSet(); + this.Genres = new System.Collections.Generic.HashSet(); + this.Artwork = new System.Collections.Generic.HashSet(); + this.Ratings = new System.Collections.Generic.HashSet(); + this.Sources = new System.Collections.Generic.HashSet(); + + Init(); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for Title + /// + protected string _Title; + /// + /// When provided in a partial class, allows value of Title to be changed before setting. + /// + partial void SetTitle(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Title to be changed before returning. + /// + partial void GetTitle(ref string result); + + /// + /// Required, Max length = 1024 + /// The title or name of the object + /// + [Required] + [MaxLength(1024)] + [StringLength(1024)] + public string Title + { + get + { + string value = _Title; + GetTitle(ref value); + return (_Title = value); + } + set + { + string oldValue = _Title; + SetTitle(oldValue, ref value); + if (oldValue != value) + { + _Title = value; + } + } + } + + /// + /// Backing field for OriginalTitle + /// + protected string _OriginalTitle; + /// + /// When provided in a partial class, allows value of OriginalTitle to be changed before setting. + /// + partial void SetOriginalTitle(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of OriginalTitle to be changed before returning. + /// + partial void GetOriginalTitle(ref string result); + + /// + /// Max length = 1024 + /// + [MaxLength(1024)] + [StringLength(1024)] + public string OriginalTitle + { + get + { + string value = _OriginalTitle; + GetOriginalTitle(ref value); + return (_OriginalTitle = value); + } + set + { + string oldValue = _OriginalTitle; + SetOriginalTitle(oldValue, ref value); + if (oldValue != value) + { + _OriginalTitle = value; + } + } + } + + /// + /// Backing field for SortTitle + /// + protected string _SortTitle; + /// + /// When provided in a partial class, allows value of SortTitle to be changed before setting. + /// + partial void SetSortTitle(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of SortTitle to be changed before returning. + /// + partial void GetSortTitle(ref string result); + + /// + /// Max length = 1024 + /// + [MaxLength(1024)] + [StringLength(1024)] + public string SortTitle + { + get + { + string value = _SortTitle; + GetSortTitle(ref value); + return (_SortTitle = value); + } + set + { + string oldValue = _SortTitle; + SetSortTitle(oldValue, ref value); + if (oldValue != value) + { + _SortTitle = value; + } + } + } + + /// + /// Backing field for Language + /// + protected string _Language; + /// + /// When provided in a partial class, allows value of Language to be changed before setting. + /// + partial void SetLanguage(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Language to be changed before returning. + /// + partial void GetLanguage(ref string result); + + /// + /// Required, Min length = 3, Max length = 3 + /// ISO-639-3 3-character language codes + /// + [Required] + [MinLength(3)] + [MaxLength(3)] + [StringLength(3)] + public string Language + { + get + { + string value = _Language; + GetLanguage(ref value); + return (_Language = value); + } + set + { + string oldValue = _Language; + SetLanguage(oldValue, ref value); + if (oldValue != value) + { + _Language = value; + } + } + } + + /// + /// Backing field for ReleaseDate + /// + protected DateTimeOffset? _ReleaseDate; + /// + /// When provided in a partial class, allows value of ReleaseDate to be changed before setting. + /// + partial void SetReleaseDate(DateTimeOffset? oldValue, ref DateTimeOffset? newValue); + /// + /// When provided in a partial class, allows value of ReleaseDate to be changed before returning. + /// + partial void GetReleaseDate(ref DateTimeOffset? result); + + public DateTimeOffset? ReleaseDate + { + get + { + DateTimeOffset? value = _ReleaseDate; + GetReleaseDate(ref value); + return (_ReleaseDate = value); + } + set + { + DateTimeOffset? oldValue = _ReleaseDate; + SetReleaseDate(oldValue, ref value); + if (oldValue != value) + { + _ReleaseDate = value; + } + } + } + + /// + /// Backing field for DateAdded + /// + protected DateTime _DateAdded; + /// + /// When provided in a partial class, allows value of DateAdded to be changed before setting. + /// + partial void SetDateAdded(DateTime oldValue, ref DateTime newValue); + /// + /// When provided in a partial class, allows value of DateAdded to be changed before returning. + /// + partial void GetDateAdded(ref DateTime result); + + /// + /// Required + /// + [Required] + public DateTime DateAdded + { + get + { + DateTime value = _DateAdded; + GetDateAdded(ref value); + return (_DateAdded = value); + } + internal set + { + DateTime oldValue = _DateAdded; + SetDateAdded(oldValue, ref value); + if (oldValue != value) + { + _DateAdded = value; + } + } + } + + /// + /// Backing field for DateModified + /// + protected DateTime _DateModified; + /// + /// When provided in a partial class, allows value of DateModified to be changed before setting. + /// + partial void SetDateModified(DateTime oldValue, ref DateTime newValue); + /// + /// When provided in a partial class, allows value of DateModified to be changed before returning. + /// + partial void GetDateModified(ref DateTime result); + + /// + /// Required + /// + [Required] + public DateTime DateModified + { + get + { + DateTime value = _DateModified; + GetDateModified(ref value); + return (_DateModified = value); + } + internal set + { + DateTime oldValue = _DateModified; + SetDateModified(oldValue, ref value); + if (oldValue != value) + { + _DateModified = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection PersonRoles { get; protected set; } + + public virtual ICollection Genres { get; protected set; } + + public virtual ICollection Artwork { get; protected set; } + + public virtual ICollection Ratings { get; protected set; } + + public virtual ICollection Sources { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/MetadataProvider.cs b/Jellyfin.Data/Entities/MetadataProvider.cs new file mode 100644 index 0000000000..3a8f5854eb --- /dev/null +++ b/Jellyfin.Data/Entities/MetadataProvider.cs @@ -0,0 +1,158 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class MetadataProvider + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected MetadataProvider() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static MetadataProvider CreateMetadataProviderUnsafe() + { + return new MetadataProvider(); + } + + /// + /// Public constructor with required data + /// + /// + public MetadataProvider(string name) + { + if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name)); + this.Name = name; + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + public static MetadataProvider Create(string name) + { + return new MetadataProvider(name); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for Name + /// + protected string _Name; + /// + /// When provided in a partial class, allows value of Name to be changed before setting. + /// + partial void SetName(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Name to be changed before returning. + /// + partial void GetName(ref string result); + + /// + /// Required, Max length = 1024 + /// + [Required] + [MaxLength(1024)] + [StringLength(1024)] + public string Name + { + get + { + string value = _Name; + GetName(ref value); + return (_Name = value); + } + set + { + string oldValue = _Name; + SetName(oldValue, ref value); + if (oldValue != value) + { + _Name = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + } +} + diff --git a/Jellyfin.Data/Entities/MetadataProviderId.cs b/Jellyfin.Data/Entities/MetadataProviderId.cs new file mode 100644 index 0000000000..87ff19e26d --- /dev/null +++ b/Jellyfin.Data/Entities/MetadataProviderId.cs @@ -0,0 +1,189 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class MetadataProviderId + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected MetadataProviderId() + { + // NOTE: This class has one-to-one associations with MetadataProviderId. + // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other. + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static MetadataProviderId CreateMetadataProviderIdUnsafe() + { + return new MetadataProviderId(); + } + + /// + /// Public constructor with required data + /// + /// + /// + /// + /// + /// + public MetadataProviderId(string providerid, global::Jellyfin.Data.Entities.Metadata _metadata0, global::Jellyfin.Data.Entities.Person _person1, global::Jellyfin.Data.Entities.PersonRole _personrole2, global::Jellyfin.Data.Entities.RatingSource _ratingsource3) + { + // NOTE: This class has one-to-one associations with MetadataProviderId. + // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other. + + if (string.IsNullOrEmpty(providerid)) throw new ArgumentNullException(nameof(providerid)); + this.ProviderId = providerid; + + if (_metadata0 == null) throw new ArgumentNullException(nameof(_metadata0)); + _metadata0.Sources.Add(this); + + if (_person1 == null) throw new ArgumentNullException(nameof(_person1)); + _person1.Sources.Add(this); + + if (_personrole2 == null) throw new ArgumentNullException(nameof(_personrole2)); + _personrole2.Sources.Add(this); + + if (_ratingsource3 == null) throw new ArgumentNullException(nameof(_ratingsource3)); + _ratingsource3.Source = this; + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + /// + /// + /// + public static MetadataProviderId Create(string providerid, global::Jellyfin.Data.Entities.Metadata _metadata0, global::Jellyfin.Data.Entities.Person _person1, global::Jellyfin.Data.Entities.PersonRole _personrole2, global::Jellyfin.Data.Entities.RatingSource _ratingsource3) + { + return new MetadataProviderId(providerid, _metadata0, _person1, _personrole2, _ratingsource3); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for ProviderId + /// + protected string _ProviderId; + /// + /// When provided in a partial class, allows value of ProviderId to be changed before setting. + /// + partial void SetProviderId(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of ProviderId to be changed before returning. + /// + partial void GetProviderId(ref string result); + + /// + /// Required, Max length = 255 + /// + [Required] + [MaxLength(255)] + [StringLength(255)] + public string ProviderId + { + get + { + string value = _ProviderId; + GetProviderId(ref value); + return (_ProviderId = value); + } + set + { + string oldValue = _ProviderId; + SetProviderId(oldValue, ref value); + if (oldValue != value) + { + _ProviderId = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + /// + /// Required + /// + public virtual global::Jellyfin.Data.Entities.MetadataProvider MetadataProvider { get; set; } + + } +} + diff --git a/Jellyfin.Data/Entities/Movie.cs b/Jellyfin.Data/Entities/Movie.cs new file mode 100644 index 0000000000..dfcc05a943 --- /dev/null +++ b/Jellyfin.Data/Entities/Movie.cs @@ -0,0 +1,84 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Movie: global::Jellyfin.Data.Entities.LibraryItem + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Movie(): base() + { + Releases = new System.Collections.Generic.HashSet(); + MovieMetadata = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Movie CreateMovieUnsafe() + { + return new Movie(); + } + + /// + /// Public constructor with required data + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + public Movie(Guid urlid, DateTime dateadded) + { + this.UrlId = urlid; + + this.Releases = new System.Collections.Generic.HashSet(); + this.MovieMetadata = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + public static Movie Create(Guid urlid, DateTime dateadded) + { + return new Movie(urlid, dateadded); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection Releases { get; protected set; } + + public virtual ICollection MovieMetadata { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/MovieMetadata.cs b/Jellyfin.Data/Entities/MovieMetadata.cs new file mode 100644 index 0000000000..bd847da8fa --- /dev/null +++ b/Jellyfin.Data/Entities/MovieMetadata.cs @@ -0,0 +1,239 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class MovieMetadata: global::Jellyfin.Data.Entities.Metadata + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected MovieMetadata(): base() + { + Studios = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static MovieMetadata CreateMovieMetadataUnsafe() + { + return new MovieMetadata(); + } + + /// + /// Public constructor with required data + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public MovieMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Movie _movie0) + { + if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title)); + this.Title = title; + + if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language)); + this.Language = language; + + if (_movie0 == null) throw new ArgumentNullException(nameof(_movie0)); + _movie0.MovieMetadata.Add(this); + + this.Studios = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public static MovieMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Movie _movie0) + { + return new MovieMetadata(title, language, dateadded, datemodified, _movie0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Outline + /// + protected string _Outline; + /// + /// When provided in a partial class, allows value of Outline to be changed before setting. + /// + partial void SetOutline(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Outline to be changed before returning. + /// + partial void GetOutline(ref string result); + + /// + /// Max length = 1024 + /// + [MaxLength(1024)] + [StringLength(1024)] + public string Outline + { + get + { + string value = _Outline; + GetOutline(ref value); + return (_Outline = value); + } + set + { + string oldValue = _Outline; + SetOutline(oldValue, ref value); + if (oldValue != value) + { + _Outline = value; + } + } + } + + /// + /// Backing field for Plot + /// + protected string _Plot; + /// + /// When provided in a partial class, allows value of Plot to be changed before setting. + /// + partial void SetPlot(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Plot to be changed before returning. + /// + partial void GetPlot(ref string result); + + /// + /// Max length = 65535 + /// + [MaxLength(65535)] + [StringLength(65535)] + public string Plot + { + get + { + string value = _Plot; + GetPlot(ref value); + return (_Plot = value); + } + set + { + string oldValue = _Plot; + SetPlot(oldValue, ref value); + if (oldValue != value) + { + _Plot = value; + } + } + } + + /// + /// Backing field for Tagline + /// + protected string _Tagline; + /// + /// When provided in a partial class, allows value of Tagline to be changed before setting. + /// + partial void SetTagline(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Tagline to be changed before returning. + /// + partial void GetTagline(ref string result); + + /// + /// Max length = 1024 + /// + [MaxLength(1024)] + [StringLength(1024)] + public string Tagline + { + get + { + string value = _Tagline; + GetTagline(ref value); + return (_Tagline = value); + } + set + { + string oldValue = _Tagline; + SetTagline(oldValue, ref value); + if (oldValue != value) + { + _Tagline = value; + } + } + } + + /// + /// Backing field for Country + /// + protected string _Country; + /// + /// When provided in a partial class, allows value of Country to be changed before setting. + /// + partial void SetCountry(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Country to be changed before returning. + /// + partial void GetCountry(ref string result); + + /// + /// Max length = 2 + /// + [MaxLength(2)] + [StringLength(2)] + public string Country + { + get + { + string value = _Country; + GetCountry(ref value); + return (_Country = value); + } + set + { + string oldValue = _Country; + SetCountry(oldValue, ref value); + if (oldValue != value) + { + _Country = value; + } + } + } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection Studios { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/MusicAlbum.cs b/Jellyfin.Data/Entities/MusicAlbum.cs new file mode 100644 index 0000000000..417f2595bd --- /dev/null +++ b/Jellyfin.Data/Entities/MusicAlbum.cs @@ -0,0 +1,84 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class MusicAlbum: global::Jellyfin.Data.Entities.LibraryItem + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected MusicAlbum(): base() + { + MusicAlbumMetadata = new System.Collections.Generic.HashSet(); + Tracks = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static MusicAlbum CreateMusicAlbumUnsafe() + { + return new MusicAlbum(); + } + + /// + /// Public constructor with required data + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + public MusicAlbum(Guid urlid, DateTime dateadded) + { + this.UrlId = urlid; + + this.MusicAlbumMetadata = new System.Collections.Generic.HashSet(); + this.Tracks = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + public static MusicAlbum Create(Guid urlid, DateTime dateadded) + { + return new MusicAlbum(urlid, dateadded); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection MusicAlbumMetadata { get; protected set; } + + public virtual ICollection Tracks { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/MusicAlbumMetadata.cs b/Jellyfin.Data/Entities/MusicAlbumMetadata.cs new file mode 100644 index 0000000000..cd72ecba51 --- /dev/null +++ b/Jellyfin.Data/Entities/MusicAlbumMetadata.cs @@ -0,0 +1,202 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class MusicAlbumMetadata: global::Jellyfin.Data.Entities.Metadata + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected MusicAlbumMetadata(): base() + { + Labels = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static MusicAlbumMetadata CreateMusicAlbumMetadataUnsafe() + { + return new MusicAlbumMetadata(); + } + + /// + /// Public constructor with required data + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public MusicAlbumMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.MusicAlbum _musicalbum0) + { + if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title)); + this.Title = title; + + if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language)); + this.Language = language; + + if (_musicalbum0 == null) throw new ArgumentNullException(nameof(_musicalbum0)); + _musicalbum0.MusicAlbumMetadata.Add(this); + + this.Labels = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public static MusicAlbumMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.MusicAlbum _musicalbum0) + { + return new MusicAlbumMetadata(title, language, dateadded, datemodified, _musicalbum0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Barcode + /// + protected string _Barcode; + /// + /// When provided in a partial class, allows value of Barcode to be changed before setting. + /// + partial void SetBarcode(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Barcode to be changed before returning. + /// + partial void GetBarcode(ref string result); + + /// + /// Max length = 255 + /// + [MaxLength(255)] + [StringLength(255)] + public string Barcode + { + get + { + string value = _Barcode; + GetBarcode(ref value); + return (_Barcode = value); + } + set + { + string oldValue = _Barcode; + SetBarcode(oldValue, ref value); + if (oldValue != value) + { + _Barcode = value; + } + } + } + + /// + /// Backing field for LabelNumber + /// + protected string _LabelNumber; + /// + /// When provided in a partial class, allows value of LabelNumber to be changed before setting. + /// + partial void SetLabelNumber(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of LabelNumber to be changed before returning. + /// + partial void GetLabelNumber(ref string result); + + /// + /// Max length = 255 + /// + [MaxLength(255)] + [StringLength(255)] + public string LabelNumber + { + get + { + string value = _LabelNumber; + GetLabelNumber(ref value); + return (_LabelNumber = value); + } + set + { + string oldValue = _LabelNumber; + SetLabelNumber(oldValue, ref value); + if (oldValue != value) + { + _LabelNumber = value; + } + } + } + + /// + /// Backing field for Country + /// + protected string _Country; + /// + /// When provided in a partial class, allows value of Country to be changed before setting. + /// + partial void SetCountry(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Country to be changed before returning. + /// + partial void GetCountry(ref string result); + + /// + /// Max length = 2 + /// + [MaxLength(2)] + [StringLength(2)] + public string Country + { + get + { + string value = _Country; + GetCountry(ref value); + return (_Country = value); + } + set + { + string oldValue = _Country; + SetCountry(oldValue, ref value); + if (oldValue != value) + { + _Country = value; + } + } + } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection Labels { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/Permission.cs b/Jellyfin.Data/Entities/Permission.cs new file mode 100644 index 0000000000..a717fc83fe --- /dev/null +++ b/Jellyfin.Data/Entities/Permission.cs @@ -0,0 +1,152 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Permission + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Permission() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Permission CreatePermissionUnsafe() + { + return new Permission(); + } + + /// + /// Public constructor with required data + /// + /// + /// + /// + /// + public Permission(global::Jellyfin.Data.Enums.PermissionKind kind, bool value, global::Jellyfin.Data.Entities.User _user0, global::Jellyfin.Data.Entities.Group _group1) + { + this.Kind = kind; + + this.Value = value; + + if (_user0 == null) throw new ArgumentNullException(nameof(_user0)); + _user0.Permissions.Add(this); + + if (_group1 == null) throw new ArgumentNullException(nameof(_group1)); + _group1.GroupPermissions.Add(this); + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + /// + /// + public static Permission Create(global::Jellyfin.Data.Enums.PermissionKind kind, bool value, global::Jellyfin.Data.Entities.User _user0, global::Jellyfin.Data.Entities.Group _group1) + { + return new Permission(kind, value, _user0, _group1); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id { get; protected set; } + + /// + /// Backing field for Kind + /// + protected global::Jellyfin.Data.Enums.PermissionKind _Kind; + /// + /// When provided in a partial class, allows value of Kind to be changed before setting. + /// + partial void SetKind(global::Jellyfin.Data.Enums.PermissionKind oldValue, ref global::Jellyfin.Data.Enums.PermissionKind newValue); + /// + /// When provided in a partial class, allows value of Kind to be changed before returning. + /// + partial void GetKind(ref global::Jellyfin.Data.Enums.PermissionKind result); + + /// + /// Required + /// + [Required] + public global::Jellyfin.Data.Enums.PermissionKind Kind + { + get + { + global::Jellyfin.Data.Enums.PermissionKind value = _Kind; + GetKind(ref value); + return (_Kind = value); + } + set + { + global::Jellyfin.Data.Enums.PermissionKind oldValue = _Kind; + SetKind(oldValue, ref value); + if (oldValue != value) + { + _Kind = value; + OnPropertyChanged(); + } + } + } + + /// + /// Required + /// + [Required] + public bool Value { get; set; } + + /// + /// Concurrency token + /// + [Timestamp] + public Byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + } +} + diff --git a/Jellyfin.Data/Entities/PermissionKind.cs b/Jellyfin.Data/Entities/PermissionKind.cs new file mode 100644 index 0000000000..971298674a --- /dev/null +++ b/Jellyfin.Data/Entities/PermissionKind.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; + +namespace Jellyfin.Data.Enums +{ + public enum PermissionKind : Int32 + { + IsAdministrator, + IsHidden, + IsDisabled, + BlockUnrateditems, + EnbleSharedDeviceControl, + EnableRemoteAccess, + EnableLiveTvManagement, + EnableLiveTvAccess, + EnableMediaPlayback, + EnableAudioPlaybackTranscoding, + EnableVideoPlaybackTranscoding, + EnableContentDeletion, + EnableContentDownloading, + EnableSyncTranscoding, + EnableMediaConversion, + EnableAllDevices, + EnableAllChannels, + EnableAllFolders, + EnablePublicSharing, + AccessSchedules + } +} diff --git a/Jellyfin.Data/Entities/Person.cs b/Jellyfin.Data/Entities/Person.cs new file mode 100644 index 0000000000..3437b9581d --- /dev/null +++ b/Jellyfin.Data/Entities/Person.cs @@ -0,0 +1,312 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Person + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Person() + { + Sources = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Person CreatePersonUnsafe() + { + return new Person(); + } + + /// + /// Public constructor with required data + /// + /// + /// + public Person(Guid urlid, string name, DateTime dateadded, DateTime datemodified) + { + this.UrlId = urlid; + + if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name)); + this.Name = name; + + this.Sources = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + public static Person Create(Guid urlid, string name, DateTime dateadded, DateTime datemodified) + { + return new Person(urlid, name, dateadded, datemodified); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for UrlId + /// + protected Guid _UrlId; + /// + /// When provided in a partial class, allows value of UrlId to be changed before setting. + /// + partial void SetUrlId(Guid oldValue, ref Guid newValue); + /// + /// When provided in a partial class, allows value of UrlId to be changed before returning. + /// + partial void GetUrlId(ref Guid result); + + /// + /// Required + /// + [Required] + public Guid UrlId + { + get + { + Guid value = _UrlId; + GetUrlId(ref value); + return (_UrlId = value); + } + set + { + Guid oldValue = _UrlId; + SetUrlId(oldValue, ref value); + if (oldValue != value) + { + _UrlId = value; + } + } + } + + /// + /// Backing field for Name + /// + protected string _Name; + /// + /// When provided in a partial class, allows value of Name to be changed before setting. + /// + partial void SetName(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Name to be changed before returning. + /// + partial void GetName(ref string result); + + /// + /// Required, Max length = 1024 + /// + [Required] + [MaxLength(1024)] + [StringLength(1024)] + public string Name + { + get + { + string value = _Name; + GetName(ref value); + return (_Name = value); + } + set + { + string oldValue = _Name; + SetName(oldValue, ref value); + if (oldValue != value) + { + _Name = value; + } + } + } + + /// + /// Backing field for SourceId + /// + protected string _SourceId; + /// + /// When provided in a partial class, allows value of SourceId to be changed before setting. + /// + partial void SetSourceId(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of SourceId to be changed before returning. + /// + partial void GetSourceId(ref string result); + + /// + /// Max length = 255 + /// + [MaxLength(255)] + [StringLength(255)] + public string SourceId + { + get + { + string value = _SourceId; + GetSourceId(ref value); + return (_SourceId = value); + } + set + { + string oldValue = _SourceId; + SetSourceId(oldValue, ref value); + if (oldValue != value) + { + _SourceId = value; + } + } + } + + /// + /// Backing field for DateAdded + /// + protected DateTime _DateAdded; + /// + /// When provided in a partial class, allows value of DateAdded to be changed before setting. + /// + partial void SetDateAdded(DateTime oldValue, ref DateTime newValue); + /// + /// When provided in a partial class, allows value of DateAdded to be changed before returning. + /// + partial void GetDateAdded(ref DateTime result); + + /// + /// Required + /// + [Required] + public DateTime DateAdded + { + get + { + DateTime value = _DateAdded; + GetDateAdded(ref value); + return (_DateAdded = value); + } + internal set + { + DateTime oldValue = _DateAdded; + SetDateAdded(oldValue, ref value); + if (oldValue != value) + { + _DateAdded = value; + } + } + } + + /// + /// Backing field for DateModified + /// + protected DateTime _DateModified; + /// + /// When provided in a partial class, allows value of DateModified to be changed before setting. + /// + partial void SetDateModified(DateTime oldValue, ref DateTime newValue); + /// + /// When provided in a partial class, allows value of DateModified to be changed before returning. + /// + partial void GetDateModified(ref DateTime result); + + /// + /// Required + /// + [Required] + public DateTime DateModified + { + get + { + DateTime value = _DateModified; + GetDateModified(ref value); + return (_DateModified = value); + } + internal set + { + DateTime oldValue = _DateModified; + SetDateModified(oldValue, ref value); + if (oldValue != value) + { + _DateModified = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection Sources { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/PersonRole.cs b/Jellyfin.Data/Entities/PersonRole.cs new file mode 100644 index 0000000000..d8e2dbc11a --- /dev/null +++ b/Jellyfin.Data/Entities/PersonRole.cs @@ -0,0 +1,215 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class PersonRole + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected PersonRole() + { + // NOTE: This class has one-to-one associations with PersonRole. + // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other. + + Sources = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static PersonRole CreatePersonRoleUnsafe() + { + return new PersonRole(); + } + + /// + /// Public constructor with required data + /// + /// + /// + public PersonRole(global::Jellyfin.Data.Enums.PersonRoleType type, global::Jellyfin.Data.Entities.Metadata _metadata0) + { + // NOTE: This class has one-to-one associations with PersonRole. + // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other. + + this.Type = type; + + if (_metadata0 == null) throw new ArgumentNullException(nameof(_metadata0)); + _metadata0.PersonRoles.Add(this); + + this.Sources = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + public static PersonRole Create(global::Jellyfin.Data.Enums.PersonRoleType type, global::Jellyfin.Data.Entities.Metadata _metadata0) + { + return new PersonRole(type, _metadata0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for Role + /// + protected string _Role; + /// + /// When provided in a partial class, allows value of Role to be changed before setting. + /// + partial void SetRole(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Role to be changed before returning. + /// + partial void GetRole(ref string result); + + /// + /// Max length = 1024 + /// + [MaxLength(1024)] + [StringLength(1024)] + public string Role + { + get + { + string value = _Role; + GetRole(ref value); + return (_Role = value); + } + set + { + string oldValue = _Role; + SetRole(oldValue, ref value); + if (oldValue != value) + { + _Role = value; + } + } + } + + /// + /// Backing field for Type + /// + protected global::Jellyfin.Data.Enums.PersonRoleType _Type; + /// + /// When provided in a partial class, allows value of Type to be changed before setting. + /// + partial void SetType(global::Jellyfin.Data.Enums.PersonRoleType oldValue, ref global::Jellyfin.Data.Enums.PersonRoleType newValue); + /// + /// When provided in a partial class, allows value of Type to be changed before returning. + /// + partial void GetType(ref global::Jellyfin.Data.Enums.PersonRoleType result); + + /// + /// Required + /// + [Required] + public global::Jellyfin.Data.Enums.PersonRoleType Type + { + get + { + global::Jellyfin.Data.Enums.PersonRoleType value = _Type; + GetType(ref value); + return (_Type = value); + } + set + { + global::Jellyfin.Data.Enums.PersonRoleType oldValue = _Type; + SetType(oldValue, ref value); + if (oldValue != value) + { + _Type = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + /// + /// Required + /// + public virtual global::Jellyfin.Data.Entities.Person Person { get; set; } + + public virtual global::Jellyfin.Data.Entities.Artwork Artwork { get; set; } + + public virtual ICollection Sources { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/Photo.cs b/Jellyfin.Data/Entities/Photo.cs new file mode 100644 index 0000000000..16c97fef54 --- /dev/null +++ b/Jellyfin.Data/Entities/Photo.cs @@ -0,0 +1,84 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Photo: global::Jellyfin.Data.Entities.LibraryItem + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Photo(): base() + { + PhotoMetadata = new System.Collections.Generic.HashSet(); + Releases = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Photo CreatePhotoUnsafe() + { + return new Photo(); + } + + /// + /// Public constructor with required data + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + public Photo(Guid urlid, DateTime dateadded) + { + this.UrlId = urlid; + + this.PhotoMetadata = new System.Collections.Generic.HashSet(); + this.Releases = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + public static Photo Create(Guid urlid, DateTime dateadded) + { + return new Photo(urlid, dateadded); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection PhotoMetadata { get; protected set; } + + public virtual ICollection Releases { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/PhotoMetadata.cs b/Jellyfin.Data/Entities/PhotoMetadata.cs new file mode 100644 index 0000000000..9c47d022e9 --- /dev/null +++ b/Jellyfin.Data/Entities/PhotoMetadata.cs @@ -0,0 +1,86 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class PhotoMetadata: global::Jellyfin.Data.Entities.Metadata + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected PhotoMetadata(): base() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static PhotoMetadata CreatePhotoMetadataUnsafe() + { + return new PhotoMetadata(); + } + + /// + /// Public constructor with required data + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public PhotoMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Photo _photo0) + { + if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title)); + this.Title = title; + + if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language)); + this.Language = language; + + if (_photo0 == null) throw new ArgumentNullException(nameof(_photo0)); + _photo0.PhotoMetadata.Add(this); + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public static PhotoMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Photo _photo0) + { + return new PhotoMetadata(title, language, dateadded, datemodified, _photo0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + } +} + diff --git a/Jellyfin.Data/Entities/Preference.cs b/Jellyfin.Data/Entities/Preference.cs new file mode 100644 index 0000000000..3d69ea2f3a --- /dev/null +++ b/Jellyfin.Data/Entities/Preference.cs @@ -0,0 +1,117 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Preference + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Preference() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Preference CreatePreferenceUnsafe() + { + return new Preference(); + } + + /// + /// Public constructor with required data + /// + /// + /// + /// + /// + public Preference(global::Jellyfin.Data.Enums.PreferenceKind kind, string value, global::Jellyfin.Data.Entities.User _user0, global::Jellyfin.Data.Entities.Group _group1) + { + this.Kind = kind; + + if (string.IsNullOrEmpty(value)) throw new ArgumentNullException(nameof(value)); + this.Value = value; + + if (_user0 == null) throw new ArgumentNullException(nameof(_user0)); + _user0.Preferences.Add(this); + + if (_group1 == null) throw new ArgumentNullException(nameof(_group1)); + _group1.Preferences.Add(this); + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + /// + /// + public static Preference Create(global::Jellyfin.Data.Enums.PreferenceKind kind, string value, global::Jellyfin.Data.Entities.User _user0, global::Jellyfin.Data.Entities.Group _group1) + { + return new Preference(kind, value, _user0, _group1); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id { get; protected set; } + + /// + /// Required + /// + [Required] + public global::Jellyfin.Data.Enums.PreferenceKind Kind { get; set; } + + /// + /// Required, Max length = 65535 + /// + [Required] + [MaxLength(65535)] + [StringLength(65535)] + public string Value { get; set; } + + /// + /// Concurrency token + /// + [Timestamp] + public Byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + } +} + diff --git a/Jellyfin.Data/Entities/PreferenceKind.cs b/Jellyfin.Data/Entities/PreferenceKind.cs new file mode 100644 index 0000000000..e6673afb1b --- /dev/null +++ b/Jellyfin.Data/Entities/PreferenceKind.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; + +namespace Jellyfin.Data.Enums +{ + public enum PreferenceKind : Int32 + { + MaxParentalRating, + BlockedTags, + RemoteClientBitrateLimit, + EnabledDevices, + EnabledChannels, + EnabledFolders, + EnableContentDeletionFromFolders + } +} diff --git a/Jellyfin.Data/Entities/ProviderMapping.cs b/Jellyfin.Data/Entities/ProviderMapping.cs new file mode 100644 index 0000000000..e50a01489c --- /dev/null +++ b/Jellyfin.Data/Entities/ProviderMapping.cs @@ -0,0 +1,133 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class ProviderMapping + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected ProviderMapping() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static ProviderMapping CreateProviderMappingUnsafe() + { + return new ProviderMapping(); + } + + /// + /// Public constructor with required data + /// + /// + /// + /// + /// + /// + public ProviderMapping(string providername, string providersecrets, string providerdata, global::Jellyfin.Data.Entities.User _user0, global::Jellyfin.Data.Entities.Group _group1) + { + if (string.IsNullOrEmpty(providername)) throw new ArgumentNullException(nameof(providername)); + this.ProviderName = providername; + + if (string.IsNullOrEmpty(providersecrets)) throw new ArgumentNullException(nameof(providersecrets)); + this.ProviderSecrets = providersecrets; + + if (string.IsNullOrEmpty(providerdata)) throw new ArgumentNullException(nameof(providerdata)); + this.ProviderData = providerdata; + + if (_user0 == null) throw new ArgumentNullException(nameof(_user0)); + _user0.ProviderMappings.Add(this); + + if (_group1 == null) throw new ArgumentNullException(nameof(_group1)); + _group1.ProviderMappings.Add(this); + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + /// + /// + /// + public static ProviderMapping Create(string providername, string providersecrets, string providerdata, global::Jellyfin.Data.Entities.User _user0, global::Jellyfin.Data.Entities.Group _group1) + { + return new ProviderMapping(providername, providersecrets, providerdata, _user0, _group1); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id { get; protected set; } + + /// + /// Required, Max length = 255 + /// + [Required] + [MaxLength(255)] + [StringLength(255)] + public string ProviderName { get; set; } + + /// + /// Required, Max length = 65535 + /// + [Required] + [MaxLength(65535)] + [StringLength(65535)] + public string ProviderSecrets { get; set; } + + /// + /// Required, Max length = 65535 + /// + [Required] + [MaxLength(65535)] + [StringLength(65535)] + public string ProviderData { get; set; } + + /// + /// Concurrency token + /// + [Timestamp] + public Byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + } +} + diff --git a/Jellyfin.Data/Entities/Rating.cs b/Jellyfin.Data/Entities/Rating.cs new file mode 100644 index 0000000000..b1098a1d7d --- /dev/null +++ b/Jellyfin.Data/Entities/Rating.cs @@ -0,0 +1,197 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Rating + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Rating() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Rating CreateRatingUnsafe() + { + return new Rating(); + } + + /// + /// Public constructor with required data + /// + /// + /// + public Rating(double value, global::Jellyfin.Data.Entities.Metadata _metadata0) + { + this.Value = value; + + if (_metadata0 == null) throw new ArgumentNullException(nameof(_metadata0)); + _metadata0.Ratings.Add(this); + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + public static Rating Create(double value, global::Jellyfin.Data.Entities.Metadata _metadata0) + { + return new Rating(value, _metadata0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for Value + /// + protected double _Value; + /// + /// When provided in a partial class, allows value of Value to be changed before setting. + /// + partial void SetValue(double oldValue, ref double newValue); + /// + /// When provided in a partial class, allows value of Value to be changed before returning. + /// + partial void GetValue(ref double result); + + /// + /// Required + /// + [Required] + public double Value + { + get + { + double value = _Value; + GetValue(ref value); + return (_Value = value); + } + set + { + double oldValue = _Value; + SetValue(oldValue, ref value); + if (oldValue != value) + { + _Value = value; + } + } + } + + /// + /// Backing field for Votes + /// + protected int? _Votes; + /// + /// When provided in a partial class, allows value of Votes to be changed before setting. + /// + partial void SetVotes(int? oldValue, ref int? newValue); + /// + /// When provided in a partial class, allows value of Votes to be changed before returning. + /// + partial void GetVotes(ref int? result); + + public int? Votes + { + get + { + int? value = _Votes; + GetVotes(ref value); + return (_Votes = value); + } + set + { + int? oldValue = _Votes; + SetVotes(oldValue, ref value); + if (oldValue != value) + { + _Votes = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + /// + /// If this is NULL it's the internal user rating. + /// + public virtual global::Jellyfin.Data.Entities.RatingSource RatingType { get; set; } + + } +} + diff --git a/Jellyfin.Data/Entities/RatingSource.cs b/Jellyfin.Data/Entities/RatingSource.cs new file mode 100644 index 0000000000..32d5634c2b --- /dev/null +++ b/Jellyfin.Data/Entities/RatingSource.cs @@ -0,0 +1,242 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + /// + /// This is the entity to store review ratings, not age ratings + /// + public partial class RatingSource + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected RatingSource() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static RatingSource CreateRatingSourceUnsafe() + { + return new RatingSource(); + } + + /// + /// Public constructor with required data + /// + /// + /// + /// + public RatingSource(double maximumvalue, double minimumvalue, global::Jellyfin.Data.Entities.Rating _rating0) + { + this.MaximumValue = maximumvalue; + + this.MinimumValue = minimumvalue; + + if (_rating0 == null) throw new ArgumentNullException(nameof(_rating0)); + _rating0.RatingType = this; + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + /// + public static RatingSource Create(double maximumvalue, double minimumvalue, global::Jellyfin.Data.Entities.Rating _rating0) + { + return new RatingSource(maximumvalue, minimumvalue, _rating0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for Name + /// + protected string _Name; + /// + /// When provided in a partial class, allows value of Name to be changed before setting. + /// + partial void SetName(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Name to be changed before returning. + /// + partial void GetName(ref string result); + + /// + /// Max length = 1024 + /// + [MaxLength(1024)] + [StringLength(1024)] + public string Name + { + get + { + string value = _Name; + GetName(ref value); + return (_Name = value); + } + set + { + string oldValue = _Name; + SetName(oldValue, ref value); + if (oldValue != value) + { + _Name = value; + } + } + } + + /// + /// Backing field for MaximumValue + /// + protected double _MaximumValue; + /// + /// When provided in a partial class, allows value of MaximumValue to be changed before setting. + /// + partial void SetMaximumValue(double oldValue, ref double newValue); + /// + /// When provided in a partial class, allows value of MaximumValue to be changed before returning. + /// + partial void GetMaximumValue(ref double result); + + /// + /// Required + /// + [Required] + public double MaximumValue + { + get + { + double value = _MaximumValue; + GetMaximumValue(ref value); + return (_MaximumValue = value); + } + set + { + double oldValue = _MaximumValue; + SetMaximumValue(oldValue, ref value); + if (oldValue != value) + { + _MaximumValue = value; + } + } + } + + /// + /// Backing field for MinimumValue + /// + protected double _MinimumValue; + /// + /// When provided in a partial class, allows value of MinimumValue to be changed before setting. + /// + partial void SetMinimumValue(double oldValue, ref double newValue); + /// + /// When provided in a partial class, allows value of MinimumValue to be changed before returning. + /// + partial void GetMinimumValue(ref double result); + + /// + /// Required + /// + [Required] + public double MinimumValue + { + get + { + double value = _MinimumValue; + GetMinimumValue(ref value); + return (_MinimumValue = value); + } + set + { + double oldValue = _MinimumValue; + SetMinimumValue(oldValue, ref value); + if (oldValue != value) + { + _MinimumValue = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual global::Jellyfin.Data.Entities.MetadataProviderId Source { get; set; } + + } +} + diff --git a/Jellyfin.Data/Entities/Release.cs b/Jellyfin.Data/Entities/Release.cs new file mode 100644 index 0000000000..e02f70be89 --- /dev/null +++ b/Jellyfin.Data/Entities/Release.cs @@ -0,0 +1,197 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Release + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Release() + { + MediaFiles = new System.Collections.Generic.HashSet(); + Chapters = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Release CreateReleaseUnsafe() + { + return new Release(); + } + + /// + /// Public constructor with required data + /// + /// + /// + /// + /// + /// + /// + /// + public Release(string name, global::Jellyfin.Data.Entities.Movie _movie0, global::Jellyfin.Data.Entities.Episode _episode1, global::Jellyfin.Data.Entities.Track _track2, global::Jellyfin.Data.Entities.CustomItem _customitem3, global::Jellyfin.Data.Entities.Book _book4, global::Jellyfin.Data.Entities.Photo _photo5) + { + if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name)); + this.Name = name; + + if (_movie0 == null) throw new ArgumentNullException(nameof(_movie0)); + _movie0.Releases.Add(this); + + if (_episode1 == null) throw new ArgumentNullException(nameof(_episode1)); + _episode1.Releases.Add(this); + + if (_track2 == null) throw new ArgumentNullException(nameof(_track2)); + _track2.Releases.Add(this); + + if (_customitem3 == null) throw new ArgumentNullException(nameof(_customitem3)); + _customitem3.Releases.Add(this); + + if (_book4 == null) throw new ArgumentNullException(nameof(_book4)); + _book4.Releases.Add(this); + + if (_photo5 == null) throw new ArgumentNullException(nameof(_photo5)); + _photo5.Releases.Add(this); + + this.MediaFiles = new System.Collections.Generic.HashSet(); + this.Chapters = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + /// + /// + /// + /// + /// + public static Release Create(string name, global::Jellyfin.Data.Entities.Movie _movie0, global::Jellyfin.Data.Entities.Episode _episode1, global::Jellyfin.Data.Entities.Track _track2, global::Jellyfin.Data.Entities.CustomItem _customitem3, global::Jellyfin.Data.Entities.Book _book4, global::Jellyfin.Data.Entities.Photo _photo5) + { + return new Release(name, _movie0, _episode1, _track2, _customitem3, _book4, _photo5); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Id + /// + internal int _Id; + /// + /// When provided in a partial class, allows value of Id to be changed before setting. + /// + partial void SetId(int oldValue, ref int newValue); + /// + /// When provided in a partial class, allows value of Id to be changed before returning. + /// + partial void GetId(ref int result); + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public int Id + { + get + { + int value = _Id; + GetId(ref value); + return (_Id = value); + } + protected set + { + int oldValue = _Id; + SetId(oldValue, ref value); + if (oldValue != value) + { + _Id = value; + } + } + } + + /// + /// Backing field for Name + /// + protected string _Name; + /// + /// When provided in a partial class, allows value of Name to be changed before setting. + /// + partial void SetName(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Name to be changed before returning. + /// + partial void GetName(ref string result); + + /// + /// Required, Max length = 1024 + /// + [Required] + [MaxLength(1024)] + [StringLength(1024)] + public string Name + { + get + { + string value = _Name; + GetName(ref value); + return (_Name = value); + } + set + { + string oldValue = _Name; + SetName(oldValue, ref value); + if (oldValue != value) + { + _Name = value; + } + } + } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] Timestamp { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection MediaFiles { get; protected set; } + + public virtual ICollection Chapters { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/Season.cs b/Jellyfin.Data/Entities/Season.cs new file mode 100644 index 0000000000..fdfdf24091 --- /dev/null +++ b/Jellyfin.Data/Entities/Season.cs @@ -0,0 +1,127 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Season: global::Jellyfin.Data.Entities.LibraryItem + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Season(): base() + { + // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem. + // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other. + + SeasonMetadata = new System.Collections.Generic.HashSet(); + Episodes = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Season CreateSeasonUnsafe() + { + return new Season(); + } + + /// + /// Public constructor with required data + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + /// + public Season(Guid urlid, DateTime dateadded, global::Jellyfin.Data.Entities.Series _series0) + { + // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem. + // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other. + + this.UrlId = urlid; + + if (_series0 == null) throw new ArgumentNullException(nameof(_series0)); + _series0.Seasons.Add(this); + + this.SeasonMetadata = new System.Collections.Generic.HashSet(); + this.Episodes = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + /// + public static Season Create(Guid urlid, DateTime dateadded, global::Jellyfin.Data.Entities.Series _series0) + { + return new Season(urlid, dateadded, _series0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for SeasonNumber + /// + protected int? _SeasonNumber; + /// + /// When provided in a partial class, allows value of SeasonNumber to be changed before setting. + /// + partial void SetSeasonNumber(int? oldValue, ref int? newValue); + /// + /// When provided in a partial class, allows value of SeasonNumber to be changed before returning. + /// + partial void GetSeasonNumber(ref int? result); + + public int? SeasonNumber + { + get + { + int? value = _SeasonNumber; + GetSeasonNumber(ref value); + return (_SeasonNumber = value); + } + set + { + int? oldValue = _SeasonNumber; + SetSeasonNumber(oldValue, ref value); + if (oldValue != value) + { + _SeasonNumber = value; + } + } + } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection SeasonMetadata { get; protected set; } + + public virtual ICollection Episodes { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/SeasonMetadata.cs b/Jellyfin.Data/Entities/SeasonMetadata.cs new file mode 100644 index 0000000000..5939cbbca1 --- /dev/null +++ b/Jellyfin.Data/Entities/SeasonMetadata.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class SeasonMetadata: global::Jellyfin.Data.Entities.Metadata + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected SeasonMetadata(): base() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static SeasonMetadata CreateSeasonMetadataUnsafe() + { + return new SeasonMetadata(); + } + + /// + /// Public constructor with required data + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public SeasonMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Season _season0) + { + if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title)); + this.Title = title; + + if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language)); + this.Language = language; + + if (_season0 == null) throw new ArgumentNullException(nameof(_season0)); + _season0.SeasonMetadata.Add(this); + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public static SeasonMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Season _season0) + { + return new SeasonMetadata(title, language, dateadded, datemodified, _season0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Outline + /// + protected string _Outline; + /// + /// When provided in a partial class, allows value of Outline to be changed before setting. + /// + partial void SetOutline(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Outline to be changed before returning. + /// + partial void GetOutline(ref string result); + + /// + /// Max length = 1024 + /// + [MaxLength(1024)] + [StringLength(1024)] + public string Outline + { + get + { + string value = _Outline; + GetOutline(ref value); + return (_Outline = value); + } + set + { + string oldValue = _Outline; + SetOutline(oldValue, ref value); + if (oldValue != value) + { + _Outline = value; + } + } + } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + } +} + diff --git a/Jellyfin.Data/Entities/Series.cs b/Jellyfin.Data/Entities/Series.cs new file mode 100644 index 0000000000..a57064824c --- /dev/null +++ b/Jellyfin.Data/Entities/Series.cs @@ -0,0 +1,183 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Series: global::Jellyfin.Data.Entities.LibraryItem + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Series(): base() + { + SeriesMetadata = new System.Collections.Generic.HashSet(); + Seasons = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Series CreateSeriesUnsafe() + { + return new Series(); + } + + /// + /// Public constructor with required data + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + public Series(Guid urlid, DateTime dateadded) + { + this.UrlId = urlid; + + this.SeriesMetadata = new System.Collections.Generic.HashSet(); + this.Seasons = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + public static Series Create(Guid urlid, DateTime dateadded) + { + return new Series(urlid, dateadded); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for AirsDayOfWeek + /// + protected global::Jellyfin.Data.Enums.Weekday? _AirsDayOfWeek; + /// + /// When provided in a partial class, allows value of AirsDayOfWeek to be changed before setting. + /// + partial void SetAirsDayOfWeek(global::Jellyfin.Data.Enums.Weekday? oldValue, ref global::Jellyfin.Data.Enums.Weekday? newValue); + /// + /// When provided in a partial class, allows value of AirsDayOfWeek to be changed before returning. + /// + partial void GetAirsDayOfWeek(ref global::Jellyfin.Data.Enums.Weekday? result); + + public global::Jellyfin.Data.Enums.Weekday? AirsDayOfWeek + { + get + { + global::Jellyfin.Data.Enums.Weekday? value = _AirsDayOfWeek; + GetAirsDayOfWeek(ref value); + return (_AirsDayOfWeek = value); + } + set + { + global::Jellyfin.Data.Enums.Weekday? oldValue = _AirsDayOfWeek; + SetAirsDayOfWeek(oldValue, ref value); + if (oldValue != value) + { + _AirsDayOfWeek = value; + } + } + } + + /// + /// Backing field for AirsTime + /// + protected DateTimeOffset? _AirsTime; + /// + /// When provided in a partial class, allows value of AirsTime to be changed before setting. + /// + partial void SetAirsTime(DateTimeOffset? oldValue, ref DateTimeOffset? newValue); + /// + /// When provided in a partial class, allows value of AirsTime to be changed before returning. + /// + partial void GetAirsTime(ref DateTimeOffset? result); + + /// + /// The time the show airs, ignore the date portion + /// + public DateTimeOffset? AirsTime + { + get + { + DateTimeOffset? value = _AirsTime; + GetAirsTime(ref value); + return (_AirsTime = value); + } + set + { + DateTimeOffset? oldValue = _AirsTime; + SetAirsTime(oldValue, ref value); + if (oldValue != value) + { + _AirsTime = value; + } + } + } + + /// + /// Backing field for FirstAired + /// + protected DateTimeOffset? _FirstAired; + /// + /// When provided in a partial class, allows value of FirstAired to be changed before setting. + /// + partial void SetFirstAired(DateTimeOffset? oldValue, ref DateTimeOffset? newValue); + /// + /// When provided in a partial class, allows value of FirstAired to be changed before returning. + /// + partial void GetFirstAired(ref DateTimeOffset? result); + + public DateTimeOffset? FirstAired + { + get + { + DateTimeOffset? value = _FirstAired; + GetFirstAired(ref value); + return (_FirstAired = value); + } + set + { + DateTimeOffset? oldValue = _FirstAired; + SetFirstAired(oldValue, ref value); + if (oldValue != value) + { + _FirstAired = value; + } + } + } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection SeriesMetadata { get; protected set; } + + public virtual ICollection Seasons { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/SeriesMetadata.cs b/Jellyfin.Data/Entities/SeriesMetadata.cs new file mode 100644 index 0000000000..9a91371dfe --- /dev/null +++ b/Jellyfin.Data/Entities/SeriesMetadata.cs @@ -0,0 +1,239 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class SeriesMetadata: global::Jellyfin.Data.Entities.Metadata + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected SeriesMetadata(): base() + { + Networks = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static SeriesMetadata CreateSeriesMetadataUnsafe() + { + return new SeriesMetadata(); + } + + /// + /// Public constructor with required data + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public SeriesMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Series _series0) + { + if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title)); + this.Title = title; + + if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language)); + this.Language = language; + + if (_series0 == null) throw new ArgumentNullException(nameof(_series0)); + _series0.SeriesMetadata.Add(this); + + this.Networks = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public static SeriesMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Series _series0) + { + return new SeriesMetadata(title, language, dateadded, datemodified, _series0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for Outline + /// + protected string _Outline; + /// + /// When provided in a partial class, allows value of Outline to be changed before setting. + /// + partial void SetOutline(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Outline to be changed before returning. + /// + partial void GetOutline(ref string result); + + /// + /// Max length = 1024 + /// + [MaxLength(1024)] + [StringLength(1024)] + public string Outline + { + get + { + string value = _Outline; + GetOutline(ref value); + return (_Outline = value); + } + set + { + string oldValue = _Outline; + SetOutline(oldValue, ref value); + if (oldValue != value) + { + _Outline = value; + } + } + } + + /// + /// Backing field for Plot + /// + protected string _Plot; + /// + /// When provided in a partial class, allows value of Plot to be changed before setting. + /// + partial void SetPlot(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Plot to be changed before returning. + /// + partial void GetPlot(ref string result); + + /// + /// Max length = 65535 + /// + [MaxLength(65535)] + [StringLength(65535)] + public string Plot + { + get + { + string value = _Plot; + GetPlot(ref value); + return (_Plot = value); + } + set + { + string oldValue = _Plot; + SetPlot(oldValue, ref value); + if (oldValue != value) + { + _Plot = value; + } + } + } + + /// + /// Backing field for Tagline + /// + protected string _Tagline; + /// + /// When provided in a partial class, allows value of Tagline to be changed before setting. + /// + partial void SetTagline(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Tagline to be changed before returning. + /// + partial void GetTagline(ref string result); + + /// + /// Max length = 1024 + /// + [MaxLength(1024)] + [StringLength(1024)] + public string Tagline + { + get + { + string value = _Tagline; + GetTagline(ref value); + return (_Tagline = value); + } + set + { + string oldValue = _Tagline; + SetTagline(oldValue, ref value); + if (oldValue != value) + { + _Tagline = value; + } + } + } + + /// + /// Backing field for Country + /// + protected string _Country; + /// + /// When provided in a partial class, allows value of Country to be changed before setting. + /// + partial void SetCountry(string oldValue, ref string newValue); + /// + /// When provided in a partial class, allows value of Country to be changed before returning. + /// + partial void GetCountry(ref string result); + + /// + /// Max length = 2 + /// + [MaxLength(2)] + [StringLength(2)] + public string Country + { + get + { + string value = _Country; + GetCountry(ref value); + return (_Country = value); + } + set + { + string oldValue = _Country; + SetCountry(oldValue, ref value); + if (oldValue != value) + { + _Country = value; + } + } + } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection Networks { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/Track.cs b/Jellyfin.Data/Entities/Track.cs new file mode 100644 index 0000000000..1d3ad372fb --- /dev/null +++ b/Jellyfin.Data/Entities/Track.cs @@ -0,0 +1,127 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class Track: global::Jellyfin.Data.Entities.LibraryItem + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected Track(): base() + { + // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem. + // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other. + + Releases = new System.Collections.Generic.HashSet(); + TrackMetadata = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static Track CreateTrackUnsafe() + { + return new Track(); + } + + /// + /// Public constructor with required data + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + /// + public Track(Guid urlid, DateTime dateadded, global::Jellyfin.Data.Entities.MusicAlbum _musicalbum0) + { + // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem. + // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other. + + this.UrlId = urlid; + + if (_musicalbum0 == null) throw new ArgumentNullException(nameof(_musicalbum0)); + _musicalbum0.Tracks.Add(this); + + this.Releases = new System.Collections.Generic.HashSet(); + this.TrackMetadata = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// This is whats gets displayed in the Urls and API requests. This could also be a string. + /// + public static Track Create(Guid urlid, DateTime dateadded, global::Jellyfin.Data.Entities.MusicAlbum _musicalbum0) + { + return new Track(urlid, dateadded, _musicalbum0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Backing field for TrackNumber + /// + protected int? _TrackNumber; + /// + /// When provided in a partial class, allows value of TrackNumber to be changed before setting. + /// + partial void SetTrackNumber(int? oldValue, ref int? newValue); + /// + /// When provided in a partial class, allows value of TrackNumber to be changed before returning. + /// + partial void GetTrackNumber(ref int? result); + + public int? TrackNumber + { + get + { + int? value = _TrackNumber; + GetTrackNumber(ref value); + return (_TrackNumber = value); + } + set + { + int? oldValue = _TrackNumber; + SetTrackNumber(oldValue, ref value); + if (oldValue != value) + { + _TrackNumber = value; + } + } + } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection Releases { get; protected set; } + + public virtual ICollection TrackMetadata { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Entities/TrackMetadata.cs b/Jellyfin.Data/Entities/TrackMetadata.cs new file mode 100644 index 0000000000..f4c61459c8 --- /dev/null +++ b/Jellyfin.Data/Entities/TrackMetadata.cs @@ -0,0 +1,86 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class TrackMetadata: global::Jellyfin.Data.Entities.Metadata + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected TrackMetadata(): base() + { + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static TrackMetadata CreateTrackMetadataUnsafe() + { + return new TrackMetadata(); + } + + /// + /// Public constructor with required data + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public TrackMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Track _track0) + { + if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title)); + this.Title = title; + + if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language)); + this.Language = language; + + if (_track0 == null) throw new ArgumentNullException(nameof(_track0)); + _track0.TrackMetadata.Add(this); + + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// The title or name of the object + /// ISO-639-3 3-character language codes + /// + public static TrackMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Track _track0) + { + return new TrackMetadata(title, language, dateadded, datemodified, _track0); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + } +} + diff --git a/Jellyfin.Data/Entities/User.cs b/Jellyfin.Data/Entities/User.cs new file mode 100644 index 0000000000..2ee3c8f4f2 --- /dev/null +++ b/Jellyfin.Data/Entities/User.cs @@ -0,0 +1,242 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.CompilerServices; + +namespace Jellyfin.Data.Entities +{ + public partial class User + { + partial void Init(); + + /// + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// + protected User() + { + Groups = new System.Collections.Generic.HashSet(); + Permissions = new System.Collections.Generic.HashSet(); + ProviderMappings = new System.Collections.Generic.HashSet(); + Preferences = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. + /// + public static User CreateUserUnsafe() + { + return new User(); + } + + /// + /// Public constructor with required data + /// + /// + /// + /// + /// + /// + /// + /// + public User(string username, bool mustupdatepassword, string audiolanguagepreference, string authenticationproviderid, int invalidloginattemptcount, string subtitlemode, bool playdefaultaudiotrack) + { + if (string.IsNullOrEmpty(username)) throw new ArgumentNullException(nameof(username)); + this.Username = username; + + this.MustUpdatePassword = mustupdatepassword; + + if (string.IsNullOrEmpty(audiolanguagepreference)) throw new ArgumentNullException(nameof(audiolanguagepreference)); + this.AudioLanguagePreference = audiolanguagepreference; + + if (string.IsNullOrEmpty(authenticationproviderid)) throw new ArgumentNullException(nameof(authenticationproviderid)); + this.AuthenticationProviderId = authenticationproviderid; + + this.InvalidLoginAttemptCount = invalidloginattemptcount; + + if (string.IsNullOrEmpty(subtitlemode)) throw new ArgumentNullException(nameof(subtitlemode)); + this.SubtitleMode = subtitlemode; + + this.PlayDefaultAudioTrack = playdefaultaudiotrack; + + this.Groups = new System.Collections.Generic.HashSet(); + this.Permissions = new System.Collections.Generic.HashSet(); + this.ProviderMappings = new System.Collections.Generic.HashSet(); + this.Preferences = new System.Collections.Generic.HashSet(); + + Init(); + } + + /// + /// Static create function (for use in LINQ queries, etc.) + /// + /// + /// + /// + /// + /// + /// + /// + public static User Create(string username, bool mustupdatepassword, string audiolanguagepreference, string authenticationproviderid, int invalidloginattemptcount, string subtitlemode, bool playdefaultaudiotrack) + { + return new User(username, mustupdatepassword, audiolanguagepreference, authenticationproviderid, invalidloginattemptcount, subtitlemode, playdefaultaudiotrack); + } + + /************************************************************************* + * Properties + *************************************************************************/ + + /// + /// Identity, Indexed, Required + /// + [Key] + [Required] + public Guid Id { get; protected set; } + + /// + /// Required + /// + [ConcurrencyCheck] + [Required] + public byte[] LastLoginTimestamp { get; set; } + + /// + /// Required, Max length = 255 + /// + [Required] + [MaxLength(255)] + [StringLength(255)] + public string Username { get; set; } + + /// + /// Max length = 65535 + /// + [MaxLength(65535)] + [StringLength(65535)] + public string Password { get; set; } + + /// + /// Required + /// + [Required] + public bool MustUpdatePassword { get; set; } + + /// + /// Required, Max length = 255 + /// + [Required] + [MaxLength(255)] + [StringLength(255)] + public string AudioLanguagePreference { get; set; } + + /// + /// Required, Max length = 255 + /// + [Required] + [MaxLength(255)] + [StringLength(255)] + public string AuthenticationProviderId { get; set; } + + /// + /// Max length = 65535 + /// + [MaxLength(65535)] + [StringLength(65535)] + public string GroupedFolders { get; set; } + + /// + /// Required + /// + [Required] + public int InvalidLoginAttemptCount { get; set; } + + /// + /// Max length = 65535 + /// + [MaxLength(65535)] + [StringLength(65535)] + public string LatestItemExcludes { get; set; } + + public int? LoginAttemptsBeforeLockout { get; set; } + + /// + /// Max length = 65535 + /// + [MaxLength(65535)] + [StringLength(65535)] + public string MyMediaExcludes { get; set; } + + /// + /// Max length = 65535 + /// + [MaxLength(65535)] + [StringLength(65535)] + public string OrderedViews { get; set; } + + /// + /// Required, Max length = 255 + /// + [Required] + [MaxLength(255)] + [StringLength(255)] + public string SubtitleMode { get; set; } + + /// + /// Required + /// + [Required] + public bool PlayDefaultAudioTrack { get; set; } + + /// + /// Max length = 255 + /// + [MaxLength(255)] + [StringLength(255)] + public string SubtitleLanguagePrefernce { get; set; } + + public bool? DisplayMissingEpisodes { get; set; } + + public bool? DisplayCollectionsView { get; set; } + + public bool? HidePlayedInLatest { get; set; } + + public bool? RememberAudioSelections { get; set; } + + public bool? RememberSubtitleSelections { get; set; } + + public bool? EnableNextEpisodeAutoPlay { get; set; } + + public bool? EnableUserPreferenceAccess { get; set; } + + /************************************************************************* + * Navigation properties + *************************************************************************/ + + public virtual ICollection Groups { get; protected set; } + + public virtual ICollection Permissions { get; protected set; } + + public virtual ICollection ProviderMappings { get; protected set; } + + public virtual ICollection Preferences { get; protected set; } + + } +} + diff --git a/Jellyfin.Data/Enums/ArtKind.cs b/Jellyfin.Data/Enums/ArtKind.cs new file mode 100644 index 0000000000..52e33048e2 --- /dev/null +++ b/Jellyfin.Data/Enums/ArtKind.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; + +namespace Jellyfin.Data.Enums +{ + public enum ArtKind : Int32 + { + Other, + Poster, + Banner, + Thumbnail, + Logo + } +} diff --git a/Jellyfin.Data/Enums/MediaFileKind.cs b/Jellyfin.Data/Enums/MediaFileKind.cs new file mode 100644 index 0000000000..34d1b20f59 --- /dev/null +++ b/Jellyfin.Data/Enums/MediaFileKind.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; + +namespace Jellyfin.Data.Enums +{ + public enum MediaFileKind : Int32 + { + Main, + Sidecar, + AdditionalPart, + AlternativeFormat, + AdditionalStream + } +} diff --git a/Jellyfin.Data/Enums/PersonRoleType.cs b/Jellyfin.Data/Enums/PersonRoleType.cs new file mode 100644 index 0000000000..f5c8f43c51 --- /dev/null +++ b/Jellyfin.Data/Enums/PersonRoleType.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; + +namespace Jellyfin.Data.Enums +{ + public enum PersonRoleType : Int32 + { + Other, + Director, + Artist, + OriginalArtist, + Actor, + VoiceActor, + Producer, + Remixer, + Conductor, + Composer, + Author, + Editor + } +} diff --git a/Jellyfin.Data/Enums/Weekday.cs b/Jellyfin.Data/Enums/Weekday.cs new file mode 100644 index 0000000000..ce0c6e4ce8 --- /dev/null +++ b/Jellyfin.Data/Enums/Weekday.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +// Produced by Entity Framework Visual Editor +// https://github.com/msawczyn/EFDesigner +// +//------------------------------------------------------------------------------ + +using System; + +namespace Jellyfin.Data.Enums +{ + public enum Weekday : Int32 + { + Sunday, + Monday, + Tuesday, + Wednesday, + Thursday, + Friday, + Saturday + } +} diff --git a/Jellyfin.Data/Jellyfin.Data.csproj b/Jellyfin.Data/Jellyfin.Data.csproj new file mode 100644 index 0000000000..73ea593b0b --- /dev/null +++ b/Jellyfin.Data/Jellyfin.Data.csproj @@ -0,0 +1,12 @@ + + + + netstandard2.0 + + + + + + + + diff --git a/Jellyfin.Data/Structs/.gitkeep b/Jellyfin.Data/Structs/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/MediaBrowser.sln b/MediaBrowser.sln index 1c84622ac0..0294ec7f3b 100644 --- a/MediaBrowser.sln +++ b/MediaBrowser.sln @@ -1,4 +1,4 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26730.3 MinimumVisualStudioVersion = 10.0.40219.1 @@ -62,6 +62,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Server.Implementat EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Controller.Tests", "tests\Jellyfin.Controller.Tests\Jellyfin.Controller.Tests.csproj", "{462584F7-5023-4019-9EAC-B98CA458C0A0}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Data", "Jellyfin.Data\Jellyfin.Data.csproj", "{F03299F2-469F-40EF-A655-3766F97A5702}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -176,6 +178,10 @@ Global {462584F7-5023-4019-9EAC-B98CA458C0A0}.Debug|Any CPU.Build.0 = Debug|Any CPU {462584F7-5023-4019-9EAC-B98CA458C0A0}.Release|Any CPU.ActiveCfg = Release|Any CPU {462584F7-5023-4019-9EAC-B98CA458C0A0}.Release|Any CPU.Build.0 = Release|Any CPU + {F03299F2-469F-40EF-A655-3766F97A5702}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F03299F2-469F-40EF-A655-3766F97A5702}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F03299F2-469F-40EF-A655-3766F97A5702}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F03299F2-469F-40EF-A655-3766F97A5702}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -183,17 +189,6 @@ Global GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {3448830C-EBDC-426C-85CD-7BBB9651A7FE} EndGlobalSection - GlobalSection(AutomaticVersions) = postSolution - UpdateAssemblyVersion = True - UpdateAssemblyFileVersion = True - UpdateAssemblyInfoVersion = True - AssemblyVersionSettings = None.None.None.None - AssemblyFileVersionSettings = None.None.None.None - AssemblyInfoVersionSettings = None.None.None.None - UpdatePackageVersion = False - AssemblyInfoVersionType = SettingsVersion - InheritWinAppVersionFrom = None - EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution Policies = $0 $0.StandardHeader = $1 From 7a550d2c4efaedc6870f0486f45477808db43c16 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 26 Apr 2020 14:57:31 -0400 Subject: [PATCH 093/115] Apply style change Co-Authored-By: Bond-009 --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 9af89112c5..cb3955b2cc 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1458,7 +1458,7 @@ namespace Emby.Server.Implementations } /// - public string GetLocalApiUrl(IPAddress ipAddress, bool forceHttp=false) + public string GetLocalApiUrl(IPAddress ipAddress, bool forceHttp = false) { if (ipAddress.AddressFamily == AddressFamily.InterNetworkV6) { From d92a3552b7add0e0c2010fe380cd29e0bac7cb26 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 26 Apr 2020 14:57:45 -0400 Subject: [PATCH 094/115] Apply style change Co-Authored-By: Bond-009 --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index cb3955b2cc..cdb06a7701 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1419,7 +1419,7 @@ namespace Emby.Server.Implementations public bool SupportsHttps => Certificate != null || ServerConfigurationManager.Configuration.IsBehindProxy; - public async Task GetLocalApiUrl(CancellationToken cancellationToken, bool forceHttp=false) + public async Task GetLocalApiUrl(CancellationToken cancellationToken, bool forceHttp = false) { try { From 015732635455c7ddd0e2b5fea28180424c4d56f3 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 26 Apr 2020 14:58:00 -0400 Subject: [PATCH 095/115] Apply style change Co-Authored-By: Bond-009 --- MediaBrowser.Controller/IServerApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.cs index 09f6cb0431..3078103316 100644 --- a/MediaBrowser.Controller/IServerApplicationHost.cs +++ b/MediaBrowser.Controller/IServerApplicationHost.cs @@ -68,7 +68,7 @@ namespace MediaBrowser.Controller /// Token to cancel the request if needed. /// Whether to force usage of plain HTTP protocol. /// The local API URL. - Task GetLocalApiUrl(CancellationToken cancellationToken, bool forceHttp=false); + Task GetLocalApiUrl(CancellationToken cancellationToken, bool forceHttp = false); /// /// Gets the local API URL. From 23c8ecff37636c3705eb5b3cf50b238c6e55e7c1 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 26 Apr 2020 14:58:24 -0400 Subject: [PATCH 096/115] Apply style change Co-Authored-By: Bond-009 --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index cdb06a7701..3bf9c6ea68 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1475,7 +1475,7 @@ namespace Emby.Server.Implementations } /// - public string GetLocalApiUrl(ReadOnlySpan host, bool forceHttp=false) + public string GetLocalApiUrl(ReadOnlySpan host, bool forceHttp = false) { var url = new StringBuilder(64); bool useHttps = EnableHttps && !forceHttp; From 6ac723706c37200e922d07657300441567574740 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 26 Apr 2020 14:58:34 -0400 Subject: [PATCH 097/115] Apply style change Co-Authored-By: Bond-009 --- MediaBrowser.Controller/IServerApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.cs index 3078103316..20c80fa47c 100644 --- a/MediaBrowser.Controller/IServerApplicationHost.cs +++ b/MediaBrowser.Controller/IServerApplicationHost.cs @@ -76,7 +76,7 @@ namespace MediaBrowser.Controller /// The hostname. /// Whether to force usage of plain HTTP protocol. /// The local API URL. - string GetLocalApiUrl(ReadOnlySpan hostname, bool forceHttp=false); + string GetLocalApiUrl(ReadOnlySpan hostname, bool forceHttp = false); /// /// Gets the local API URL. From cbeeeced759de0452d75b3d6daa11bb213ff2a26 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 26 Apr 2020 14:58:43 -0400 Subject: [PATCH 098/115] Apply style change Co-Authored-By: Bond-009 --- MediaBrowser.Controller/IServerApplicationHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.cs index 20c80fa47c..04ba0fabcb 100644 --- a/MediaBrowser.Controller/IServerApplicationHost.cs +++ b/MediaBrowser.Controller/IServerApplicationHost.cs @@ -84,7 +84,7 @@ namespace MediaBrowser.Controller /// The IP address. /// Whether to force usage of plain HTTP protocol. /// The local API URL. - string GetLocalApiUrl(IPAddress address, bool forceHttp=false); + string GetLocalApiUrl(IPAddress address, bool forceHttp = false); /// /// Open a URL in an external browser window. From cbd62e00a4f0f63e7cc725f3bce000e9ae3c6a0d Mon Sep 17 00:00:00 2001 From: Mark Monteiro Date: Sun, 26 Apr 2020 15:04:57 -0400 Subject: [PATCH 099/115] Ensure transcoding path is created when it is retrieved --- .../EncodingConfigurationExtensions.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Common/Configuration/EncodingConfigurationExtensions.cs b/MediaBrowser.Common/Configuration/EncodingConfigurationExtensions.cs index ccf9658988..89740ae084 100644 --- a/MediaBrowser.Common/Configuration/EncodingConfigurationExtensions.cs +++ b/MediaBrowser.Common/Configuration/EncodingConfigurationExtensions.cs @@ -1,3 +1,4 @@ +using System; using System.IO; using MediaBrowser.Model.Configuration; @@ -17,18 +18,25 @@ namespace MediaBrowser.Common.Configuration => configurationManager.GetConfiguration("encoding"); /// - /// Retrieves the transcoding temp path from the encoding configuration. + /// Retrieves the transcoding temp path from the encoding configuration, falling back to a default if no path + /// is specified in configuration. If the directory does not exist, it will be created. /// - /// The Configuration manager. + /// The configuration manager. /// The transcoding temp path. + /// If the directory does not exist, and the caller does not have the required permission to create it. + /// If there is a custom path transcoding path specified, but it is invalid. + /// If the directory does not exist, and it also could not be created. public static string GetTranscodePath(this IConfigurationManager configurationManager) { + // Get the configured path and fall back to a default var transcodingTempPath = configurationManager.GetEncodingOptions().TranscodingTempPath; if (string.IsNullOrEmpty(transcodingTempPath)) { - return Path.Combine(configurationManager.CommonApplicationPaths.ProgramDataPath, "transcodes"); + transcodingTempPath = Path.Combine(configurationManager.CommonApplicationPaths.ProgramDataPath, "transcodes"); } + // Make sure the directory exists + Directory.CreateDirectory(transcodingTempPath); return transcodingTempPath; } } From 7615cdc963cdfb16313e8704c047fd4108510742 Mon Sep 17 00:00:00 2001 From: Mark Monteiro Date: Sun, 26 Apr 2020 15:30:37 -0400 Subject: [PATCH 100/115] Ensure metadata path is created on app startup, and also each time it is updated --- .../Configuration/ServerConfigurationManager.cs | 6 +++++- .../ServerApplicationPaths.cs | 12 +++++------- MediaBrowser.Controller/IServerApplicationPaths.cs | 7 ++++++- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs index 0ff70decae..a6eaf2d0a3 100644 --- a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs +++ b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs @@ -67,11 +67,15 @@ namespace Emby.Server.Implementations.Configuration /// /// Updates the metadata path. /// + /// If the directory does not exist, and the caller does not have the required permission to create it. + /// If there is a custom path transcoding path specified, but it is invalid. + /// If the directory does not exist, and it also could not be created. private void UpdateMetadataPath() { ((ServerApplicationPaths)ApplicationPaths).InternalMetadataPath = string.IsNullOrWhiteSpace(Configuration.MetadataPath) - ? Path.Combine(ApplicationPaths.ProgramDataPath, "metadata") + ? ApplicationPaths.DefaultInternalMetadataPath : Configuration.MetadataPath; + Directory.CreateDirectory(ApplicationPaths.InternalMetadataPath); } /// diff --git a/Emby.Server.Implementations/ServerApplicationPaths.cs b/Emby.Server.Implementations/ServerApplicationPaths.cs index 2f57c97a13..dfdd4200e0 100644 --- a/Emby.Server.Implementations/ServerApplicationPaths.cs +++ b/Emby.Server.Implementations/ServerApplicationPaths.cs @@ -9,8 +9,6 @@ namespace Emby.Server.Implementations /// public class ServerApplicationPaths : BaseApplicationPaths, IServerApplicationPaths { - private string _internalMetadataPath; - /// /// Initializes a new instance of the class. /// @@ -27,6 +25,7 @@ namespace Emby.Server.Implementations cacheDirectoryPath, webDirectoryPath) { + InternalMetadataPath = DefaultInternalMetadataPath; } /// @@ -98,12 +97,11 @@ namespace Emby.Server.Implementations /// The user configuration directory path. public string UserConfigurationDirectoryPath => Path.Combine(ConfigurationDirectoryPath, "users"); + /// + public string DefaultInternalMetadataPath => Path.Combine(ProgramDataPath, "metadata"); + /// - public string InternalMetadataPath - { - get => _internalMetadataPath ?? (_internalMetadataPath = Path.Combine(DataPath, "metadata")); - set => _internalMetadataPath = value; - } + public string InternalMetadataPath { get; set; } /// public string VirtualInternalMetadataPath { get; } = "%MetadataPath%"; diff --git a/MediaBrowser.Controller/IServerApplicationPaths.cs b/MediaBrowser.Controller/IServerApplicationPaths.cs index 5d7c60910a..c35a22ac70 100644 --- a/MediaBrowser.Controller/IServerApplicationPaths.cs +++ b/MediaBrowser.Controller/IServerApplicationPaths.cs @@ -71,7 +71,12 @@ namespace MediaBrowser.Controller string UserConfigurationDirectoryPath { get; } /// - /// Gets the internal metadata path. + /// Gets the default internal metadata path. + /// + string DefaultInternalMetadataPath { get; } + + /// + /// Gets the internal metadata path, either a custom path or the default. /// /// The internal metadata path. string InternalMetadataPath { get; } From 241dea6706dc79deb80e7416a1b0a1b58e93f403 Mon Sep 17 00:00:00 2001 From: oytal Date: Sun, 26 Apr 2020 18:51:14 +0000 Subject: [PATCH 101/115] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegi?= =?UTF-8?q?an=20Bokm=C3=A5l)=20Translation:=20Jellyfin/Jellyfin=20Translat?= =?UTF-8?q?e-URL:=20https://translate.jellyfin.org/projects/jellyfin/jelly?= =?UTF-8?q?fin-core/nb=5FNO/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Emby.Server.Implementations/Localization/Core/nb.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/Localization/Core/nb.json b/Emby.Server.Implementations/Localization/Core/nb.json index e523ae90ba..50d0d083cb 100644 --- a/Emby.Server.Implementations/Localization/Core/nb.json +++ b/Emby.Server.Implementations/Localization/Core/nb.json @@ -96,5 +96,6 @@ "TasksChannelsCategory": "Internett kanaler", "TasksApplicationCategory": "Applikasjon", "TasksLibraryCategory": "Bibliotek", - "TasksMaintenanceCategory": "Vedlikehold" + "TasksMaintenanceCategory": "Vedlikehold", + "TaskCleanCache": "Tøm buffer katalog" } From c38e414178d69803872948a0ef19c2957a84d05e Mon Sep 17 00:00:00 2001 From: Shillos Date: Sun, 26 Apr 2020 21:56:08 +0000 Subject: [PATCH 102/115] Translated using Weblate (Greek) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/el/ --- .../Localization/Core/el.json | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/Localization/Core/el.json b/Emby.Server.Implementations/Localization/Core/el.json index 53e2f58de8..08d755fc37 100644 --- a/Emby.Server.Implementations/Localization/Core/el.json +++ b/Emby.Server.Implementations/Localization/Core/el.json @@ -92,5 +92,18 @@ "UserStoppedPlayingItemWithValues": "{0} τελείωσε να παίζει {1} σε {2}", "ValueHasBeenAddedToLibrary": "{0} προστέθηκαν στη βιβλιοθήκη πολυμέσων σας", "ValueSpecialEpisodeName": "Σπέσιαλ - {0}", - "VersionNumber": "Έκδοση {0}" + "VersionNumber": "Έκδοση {0}", + "TaskRefreshPeople": "Ανανέωση Ατόμων", + "TaskCleanLogsDescription": "Διαγράφει τα αρχεία καταγραφής που είναι άνω των {0} ημερών.", + "TaskCleanLogs": "Καθαρισμός Καταλόγου Καταγραφής", + "TaskRefreshLibraryDescription": "Σαρώνει την βιβλιοθήκη πολυμέσων σας για νέα αρχεία και αναζωογονεί τα μεταδεδομένα.", + "TaskRefreshLibrary": "Βιβλιοθήκη Σάρωσης Πολυμέσων", + "TaskRefreshChapterImagesDescription": "Δημιουργεί μικρογραφίες για βίντεο με κεφάλαια.", + "TaskRefreshChapterImages": "Εξαγωγή Εικόνων Κεφαλαίου", + "TaskCleanCacheDescription": "Τα διαγραμμένα αρχεία προσωρινής μνήμης που δεν χρειάζονται πλέον από το σύστημα.", + "TaskCleanCache": "Καθαρισμός Καταλόγου Προσωρινής Μνήμης", + "TasksChannelsCategory": "Κανάλια Διαδικτύου", + "TasksApplicationCategory": "Εφαρμογή", + "TasksLibraryCategory": "Βιβλιοθήκη", + "TasksMaintenanceCategory": "Συντήρηση" } From 820cd7e6449d708eb8f272167c8da30754eea9b2 Mon Sep 17 00:00:00 2001 From: Shillos Date: Sun, 26 Apr 2020 22:08:43 +0000 Subject: [PATCH 103/115] Translated using Weblate (Greek) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/el/ --- .../Localization/Core/el.json | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Emby.Server.Implementations/Localization/Core/el.json b/Emby.Server.Implementations/Localization/Core/el.json index 08d755fc37..0753ea39d4 100644 --- a/Emby.Server.Implementations/Localization/Core/el.json +++ b/Emby.Server.Implementations/Localization/Core/el.json @@ -1,5 +1,5 @@ { - "Albums": "Άλμπουμ", + "Albums": "Άλμπουμς", "AppDeviceValues": "Εφαρμογή: {0}, Συσκευή: {1}", "Application": "Εφαρμογή", "Artists": "Καλλιτέχνες", @@ -105,5 +105,14 @@ "TasksChannelsCategory": "Κανάλια Διαδικτύου", "TasksApplicationCategory": "Εφαρμογή", "TasksLibraryCategory": "Βιβλιοθήκη", - "TasksMaintenanceCategory": "Συντήρηση" + "TasksMaintenanceCategory": "Συντήρηση", + "TaskDownloadMissingSubtitlesDescription": "Αναζητήσεις στο διαδίκτυο όπου λείπουν υπότιτλους με βάση τη διαμόρφωση μεταδεδομένων.", + "TaskDownloadMissingSubtitles": "Λήψη υπότιτλων που λείπουν", + "TaskRefreshChannelsDescription": "Ανανεώνει τις πληροφορίες καναλιού στο διαδικτύου.", + "TaskRefreshChannels": "Ανανέωση Καναλιών", + "TaskCleanTranscodeDescription": "Διαγράφει αρχείου διακωδικοποιητή περισσότερο από μία ημέρα.", + "TaskCleanTranscode": "Καθαρισμός Kαταλόγου Διακωδικοποιητή", + "TaskUpdatePluginsDescription": "Κατεβάζει και εγκαθιστά ενημερώσεις για τις προσθήκες που έχουν ρυθμιστεί για αυτόματη ενημέρωση.", + "TaskUpdatePlugins": "Ενημέρωση Προσθηκών", + "TaskRefreshPeopleDescription": "Ενημερώνει μεταδεδομένα για ηθοποιούς και σκηνοθέτες στην βιβλιοθήκη των πολυμέσων σας." } From cee587d6e358cbb16b8cd27b55f492c145476c5a Mon Sep 17 00:00:00 2001 From: Max Git Date: Mon, 27 Apr 2020 03:25:57 +0200 Subject: [PATCH 104/115] Try harder to find ffmpeg in app directory. While here do some cleanup --- .../Encoder/MediaEncoder.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index 992ad146d8..1377502dd9 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -113,7 +113,7 @@ namespace MediaBrowser.MediaEncoding.Encoder SetAvailableEncoders(validator.GetEncoders()); } - _logger.LogInformation("FFmpeg: {0}: {1}", EncoderLocation, _ffmpegPath ?? string.Empty); + _logger.LogInformation("FFmpeg: {EncoderLocation}: {FfmpegPath}", EncoderLocation, _ffmpegPath ?? string.Empty); } /// @@ -126,7 +126,7 @@ namespace MediaBrowser.MediaEncoding.Encoder { string newPath; - _logger.LogInformation("Attempting to update encoder path to {0}. pathType: {1}", path ?? string.Empty, pathType ?? string.Empty); + _logger.LogInformation("Attempting to update encoder path to {Path}. pathType: {PathType}", path ?? string.Empty, pathType ?? string.Empty); if (!string.Equals(pathType, "custom", StringComparison.OrdinalIgnoreCase)) { @@ -180,7 +180,7 @@ namespace MediaBrowser.MediaEncoding.Encoder if (!rc) { - _logger.LogWarning("FFmpeg: {0}: Failed version check: {1}", location, path); + _logger.LogWarning("FFmpeg: {Location}: Failed version check: {Path}", location, path); } // ToDo - Enable the ffmpeg validator. At the moment any version can be used. @@ -191,18 +191,18 @@ namespace MediaBrowser.MediaEncoding.Encoder } else { - _logger.LogWarning("FFmpeg: {0}: File not found: {1}", location, path); + _logger.LogWarning("FFmpeg: {Location}: File not found: {Path}", location, path); } } return rc; } - private string GetEncoderPathFromDirectory(string path, string filename) + private string GetEncoderPathFromDirectory(string path, string filename, bool recursive = false) { try { - var files = _fileSystem.GetFilePaths(path); + var files = _fileSystem.GetFilePaths(path, recursive); var excludeExtensions = new[] { ".c" }; @@ -223,7 +223,7 @@ namespace MediaBrowser.MediaEncoding.Encoder /// private string ExistsOnSystemPath(string fileName) { - string inJellyfinPath = GetEncoderPathFromDirectory(System.AppContext.BaseDirectory, fileName); + var inJellyfinPath = GetEncoderPathFromDirectory(AppContext.BaseDirectory, fileName, recursive: true); if (!string.IsNullOrEmpty(inJellyfinPath)) { return inJellyfinPath; @@ -892,7 +892,7 @@ namespace MediaBrowser.MediaEncoding.Encoder return minSizeVobs.Count == 0 ? vobs.Select(i => i.FullName) : minSizeVobs.Select(i => i.FullName); } - _logger.LogWarning("Could not determine vob file list for {0} using DvdLib. Will scan using file sizes.", path); + _logger.LogWarning("Could not determine vob file list for {Path} using DvdLib. Will scan using file sizes.", path); } var files = allVobs From e3a42a8fe93727d43d02a9b560a53661f12230b8 Mon Sep 17 00:00:00 2001 From: sparky8251 Date: Mon, 27 Apr 2020 08:42:46 -0400 Subject: [PATCH 105/115] Address reviews --- .../ApplicationHost.cs | 2 +- .../Routines/DisableMetricsCollection.cs | 33 ------------------- Jellyfin.Server/Startup.cs | 3 +- 3 files changed, 3 insertions(+), 35 deletions(-) delete mode 100644 Jellyfin.Server/Migrations/Routines/DisableMetricsCollection.cs diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 7e7b785d85..b9aaaa2065 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -263,7 +263,7 @@ namespace Emby.Server.Implementations // Initialize runtime stat collection if (ServerConfigurationManager.Configuration.EnableMetrics) { - IDisposable collector = DotNetRuntimeStatsBuilder.Default().StartCollecting(); + DotNetRuntimeStatsBuilder.Default().StartCollecting(); } fileSystem.AddShortcutHandler(new MbLinkShortcutHandler(fileSystem)); diff --git a/Jellyfin.Server/Migrations/Routines/DisableMetricsCollection.cs b/Jellyfin.Server/Migrations/Routines/DisableMetricsCollection.cs deleted file mode 100644 index b5dc43614e..0000000000 --- a/Jellyfin.Server/Migrations/Routines/DisableMetricsCollection.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using MediaBrowser.Common.Configuration; -using MediaBrowser.Model.Configuration; -using Microsoft.Extensions.Logging; - -namespace Jellyfin.Server.Migrations.Routines -{ - /// - /// Disable metrics collections for all installations since it can be a security risk if not properly secured. - /// - internal class DisableMetricsCollection : IMigrationRoutine - { - /// - public Guid Id => Guid.Parse("{4124C2CD-E939-4FFB-9BE9-9B311C413638}"); - - /// - public string Name => "DisableMetricsCollection"; - - /// - public void Perform(CoreAppHost host, ILogger logger) - { - // Set EnableMetrics to false since it can leak sensitive information if not properly secured - var metrics = host.ServerConfigurationManager.Configuration.EnableMetrics; - if (metrics) - { - logger.LogInformation("Disabling metrics collection during migration"); - metrics = false; - - host.ServerConfigurationManager.SaveConfiguration("false", metrics); - } - } - } -} diff --git a/Jellyfin.Server/Startup.cs b/Jellyfin.Server/Startup.cs index 2cc7cff87e..8bcfd13504 100644 --- a/Jellyfin.Server/Startup.cs +++ b/Jellyfin.Server/Startup.cs @@ -72,7 +72,8 @@ namespace Jellyfin.Server app.UseAuthorization(); if (_serverConfigurationManager.Configuration.EnableMetrics) { - app.UseHttpMetrics(); // Must be registered after any middleware that could chagne HTTP response codes or the data will be bad + // Must be registered after any middleware that could chagne HTTP response codes or the data will be bad + app.UseHttpMetrics(); } app.UseEndpoints(endpoints => From 655208d375bce4a5c82bf8da87d5d72814a8da83 Mon Sep 17 00:00:00 2001 From: Vasily Date: Mon, 27 Apr 2020 19:03:42 +0300 Subject: [PATCH 106/115] Now parse date in header correctly as being in UTC --- Emby.Server.Implementations/HttpServer/HttpResultFactory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs index 464ca3a0b5..2e9ecc4ae6 100644 --- a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -426,7 +426,7 @@ namespace Emby.Server.Implementations.HttpServer if (!noCache) { - if (!DateTime.TryParseExact(requestContext.Headers[HeaderNames.IfModifiedSince], HttpDateFormat, _enUSculture, DateTimeStyles.AssumeUniversal, out var ifModifiedSinceHeader)) + if (!DateTime.TryParseExact(requestContext.Headers[HeaderNames.IfModifiedSince], HttpDateFormat, _enUSculture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal, out var ifModifiedSinceHeader)) { _logger.LogDebug("Failed to parse If-Modified-Since header date: {0}", requestContext.Headers[HeaderNames.IfModifiedSince]); return null; From ab8a5595f609ab54e017ecabadc841d181acd4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Nowak?= Date: Mon, 27 Apr 2020 17:14:00 +0000 Subject: [PATCH 107/115] Translated using Weblate (Polish) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/pl/ --- .../Localization/Core/pl.json | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/Localization/Core/pl.json b/Emby.Server.Implementations/Localization/Core/pl.json index e9d9bbf2e1..bdc0d0169b 100644 --- a/Emby.Server.Implementations/Localization/Core/pl.json +++ b/Emby.Server.Implementations/Localization/Core/pl.json @@ -92,5 +92,27 @@ "UserStoppedPlayingItemWithValues": "{0} zakończył odtwarzanie {1} na {2}", "ValueHasBeenAddedToLibrary": "{0} został dodany do biblioteki mediów", "ValueSpecialEpisodeName": "Specjalne - {0}", - "VersionNumber": "Wersja {0}" + "VersionNumber": "Wersja {0}", + "TaskDownloadMissingSubtitlesDescription": "Przeszukuje internet w poszukiwaniu brakujących napisów w oparciu o konfigurację metadanych.", + "TaskDownloadMissingSubtitles": "Pobierz brakujące napisy", + "TaskRefreshChannelsDescription": "Odświeża informacje o kanałach internetowych.", + "TaskRefreshChannels": "Odśwież kanały", + "TaskCleanTranscodeDescription": "Usuwa transkodowane pliki starsze niż 1 dzień.", + "TaskCleanTranscode": "Wyczyść folder transkodowania", + "TaskUpdatePluginsDescription": "Pobiera i instaluje aktualizacje dla pluginów które są skonfigurowane do automatycznej aktualizacji.", + "TaskUpdatePlugins": "Aktualizuj pluginy", + "TaskRefreshPeopleDescription": "Odświeża metadane o aktorów i reżyserów w Twojej bibliotece mediów.", + "TaskRefreshPeople": "Odśwież obsadę", + "TaskCleanLogsDescription": "Kasuje pliki logów starsze niż {0} dni.", + "TaskCleanLogs": "Wyczyść folder logów", + "TaskRefreshLibraryDescription": "Skanuje Twoją bibliotekę mediów dla nowych plików i odświeżenia metadanych.", + "TaskRefreshLibrary": "Skanuj bibliotekę mediów", + "TaskRefreshChapterImagesDescription": "Tworzy miniatury dla filmów posiadających rozdziały.", + "TaskRefreshChapterImages": "Wydobądź grafiki rozdziałów", + "TaskCleanCacheDescription": "Usuwa niepotrzebne i przestarzałe pliki cache.", + "TaskCleanCache": "Wyczyść folder Cache", + "TasksChannelsCategory": "Kanały internetowe", + "TasksApplicationCategory": "Aplikacja", + "TasksLibraryCategory": "Biblioteka", + "TasksMaintenanceCategory": "Konserwacja" } From 8c9604afba027baed71ad5f0775679228869f079 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 29 Apr 2020 16:06:42 -0400 Subject: [PATCH 108/115] Add Web integration option in default service conf --- debian/conf/jellyfin | 5 ++++- debian/jellyfin.service | 2 +- fedora/jellyfin.env | 3 +++ fedora/jellyfin.service | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/debian/conf/jellyfin b/debian/conf/jellyfin index c6e595f15a..64c98520cb 100644 --- a/debian/conf/jellyfin +++ b/debian/conf/jellyfin @@ -18,6 +18,9 @@ JELLYFIN_CONFIG_DIR="/etc/jellyfin" JELLYFIN_LOG_DIR="/var/log/jellyfin" JELLYFIN_CACHE_DIR="/var/cache/jellyfin" +# web client path, installed by the jellyfin-web package +JELLYFIN_WEB_OPT="--webdir=/usr/share/jellyfin/web" + # Restart script for in-app server control JELLYFIN_RESTART_OPT="--restartpath=/usr/lib/jellyfin/restart.sh" @@ -37,4 +40,4 @@ JELLYFIN_FFMPEG_OPT="--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg" # Application username JELLYFIN_USER="jellyfin" # Full application command -JELLYFIN_ARGS="$JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLFIN_NOWEBAPP_OPT" +JELLYFIN_ARGS="$JELLYFIN_WEB_OPT $JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLFIN_NOWEBAPP_OPT" diff --git a/debian/jellyfin.service b/debian/jellyfin.service index 1305e238b0..f1a8f4652c 100644 --- a/debian/jellyfin.service +++ b/debian/jellyfin.service @@ -6,7 +6,7 @@ After = network.target Type = simple EnvironmentFile = /etc/default/jellyfin User = jellyfin -ExecStart = /usr/bin/jellyfin ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT} +ExecStart = /usr/bin/jellyfin ${JELLYFIN_WEB_OPT} ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT} Restart = on-failure TimeoutSec = 15 diff --git a/fedora/jellyfin.env b/fedora/jellyfin.env index de48f13af5..bf64acd3f9 100644 --- a/fedora/jellyfin.env +++ b/fedora/jellyfin.env @@ -20,6 +20,9 @@ JELLYFIN_CONFIG_DIR="/etc/jellyfin" JELLYFIN_LOG_DIR="/var/log/jellyfin" JELLYFIN_CACHE_DIR="/var/cache/jellyfin" +# web client path, installed by the jellyfin-web package +JELLYFIN_WEB_OPT="--webdir=/usr/share/jellyfin-web" + # In-App service control JELLYFIN_RESTART_OPT="--restartpath=/usr/libexec/jellyfin/restart.sh" diff --git a/fedora/jellyfin.service b/fedora/jellyfin.service index f3dc594b1c..b092ebf2f0 100644 --- a/fedora/jellyfin.service +++ b/fedora/jellyfin.service @@ -5,7 +5,7 @@ Description=Jellyfin is a free software media system that puts you in control of [Service] EnvironmentFile=/etc/sysconfig/jellyfin WorkingDirectory=/var/lib/jellyfin -ExecStart=/usr/bin/jellyfin ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT} +ExecStart=/usr/bin/jellyfin ${JELLYFIN_WEB_OPT} ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT} TimeoutSec=15 Restart=on-failure User=jellyfin From a370c5c007850196a41c2d6550498310ab73a999 Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Thu, 30 Apr 2020 10:03:49 +0200 Subject: [PATCH 109/115] Restore the versioning extension settings. --- MediaBrowser.sln | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/MediaBrowser.sln b/MediaBrowser.sln index 0294ec7f3b..aaf672ec00 100644 --- a/MediaBrowser.sln +++ b/MediaBrowser.sln @@ -189,6 +189,17 @@ Global GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {3448830C-EBDC-426C-85CD-7BBB9651A7FE} EndGlobalSection + GlobalSection(AutomaticVersions) = postSolution + UpdateAssemblyVersion = True + UpdateAssemblyFileVersion = True + UpdateAssemblyInfoVersion = True + AssemblyVersionSettings = None.None.None.None + AssemblyFileVersionSettings = None.None.None.None + AssemblyInfoVersionSettings = None.None.None.None + UpdatePackageVersion = False + AssemblyInfoVersionType = SettingsVersion + InheritWinAppVersionFrom = None + EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution Policies = $0 $0.StandardHeader = $1 From bbd74f811f053fc849e459fc12f1397de8732024 Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Thu, 30 Apr 2020 10:06:02 +0200 Subject: [PATCH 110/115] Spaces -> Tab in solution file --- MediaBrowser.sln | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.sln b/MediaBrowser.sln index aaf672ec00..a1dbe80476 100644 --- a/MediaBrowser.sln +++ b/MediaBrowser.sln @@ -189,7 +189,7 @@ Global GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {3448830C-EBDC-426C-85CD-7BBB9651A7FE} EndGlobalSection - GlobalSection(AutomaticVersions) = postSolution + GlobalSection(AutomaticVersions) = postSolution UpdateAssemblyVersion = True UpdateAssemblyFileVersion = True UpdateAssemblyInfoVersion = True From c342c6b582e96ecfec0c762d451acb91dba6cd32 Mon Sep 17 00:00:00 2001 From: fesken Date: Thu, 30 Apr 2020 18:57:10 +0000 Subject: [PATCH 111/115] Translated using Weblate (Swedish) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/sv/ --- Emby.Server.Implementations/Localization/Core/sv.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Emby.Server.Implementations/Localization/Core/sv.json b/Emby.Server.Implementations/Localization/Core/sv.json index b7c50394ae..c8662b2cab 100644 --- a/Emby.Server.Implementations/Localization/Core/sv.json +++ b/Emby.Server.Implementations/Localization/Core/sv.json @@ -9,7 +9,7 @@ "Channels": "Kanaler", "ChapterNameValue": "Kapitel {0}", "Collections": "Samlingar", - "DeviceOfflineWithName": "{0} har tappat anslutningen", + "DeviceOfflineWithName": "{0} har kopplat från", "DeviceOnlineWithName": "{0} är ansluten", "FailedLoginAttemptWithUserName": "Misslyckat inloggningsförsök från {0}", "Favorites": "Favoriter", @@ -50,7 +50,7 @@ "NotificationOptionAudioPlayback": "Ljuduppspelning har påbörjats", "NotificationOptionAudioPlaybackStopped": "Ljuduppspelning stoppades", "NotificationOptionCameraImageUploaded": "Kamerabild har laddats upp", - "NotificationOptionInstallationFailed": "Fel vid installation", + "NotificationOptionInstallationFailed": "Installationen misslyckades", "NotificationOptionNewLibraryContent": "Nytt innehåll har lagts till", "NotificationOptionPluginError": "Fel uppstod med tillägget", "NotificationOptionPluginInstalled": "Tillägg har installerats", @@ -113,5 +113,6 @@ "TasksChannelsCategory": "Internetkanaler", "TasksApplicationCategory": "Applikation", "TasksLibraryCategory": "Bibliotek", - "TasksMaintenanceCategory": "Underhåll" + "TasksMaintenanceCategory": "Underhåll", + "TaskRefreshPeople": "Uppdatera Personer" } From 8b6bec60d3693fadbe958c83fee5abab4a2ec0e1 Mon Sep 17 00:00:00 2001 From: Heikki Jetsonen Date: Thu, 30 Apr 2020 23:34:43 +0000 Subject: [PATCH 112/115] Translated using Weblate (Finnish) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fi/ --- .../Localization/Core/fi.json | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Emby.Server.Implementations/Localization/Core/fi.json b/Emby.Server.Implementations/Localization/Core/fi.json index b39adefe70..4ed7b301a8 100644 --- a/Emby.Server.Implementations/Localization/Core/fi.json +++ b/Emby.Server.Implementations/Localization/Core/fi.json @@ -1,5 +1,5 @@ { - "HeaderLiveTV": "Suorat lähetykset", + "HeaderLiveTV": "Live-TV", "NewVersionIsAvailable": "Uusi versio Jellyfin palvelimesta on ladattavissa.", "NameSeasonUnknown": "Tuntematon Kausi", "NameSeasonNumber": "Kausi {0}", @@ -67,21 +67,21 @@ "UserDownloadingItemWithValues": "{0} lataa {1}", "UserDeletedWithName": "Käyttäjä {0} poistettu", "UserCreatedWithName": "Käyttäjä {0} luotu", - "TvShows": "TV-Ohjelmat", + "TvShows": "TV-sarjat", "Sync": "Synkronoi", - "SubtitleDownloadFailureFromForItem": "Tekstityksen lataaminen epäonnistui {0} - {1}", + "SubtitleDownloadFailureFromForItem": "Tekstitysten lataus ({0} -> {1}) epäonnistui //this string would have to be generated for each provider and movie because of finnish cases, sorry", "StartupEmbyServerIsLoading": "Jellyfin palvelin latautuu. Kokeile hetken kuluttua uudelleen.", "Songs": "Kappaleet", - "Shows": "Ohjelmat", - "ServerNameNeedsToBeRestarted": "{0} vaatii uudelleenkäynnistyksen", + "Shows": "Sarjat", + "ServerNameNeedsToBeRestarted": "{0} täytyy käynnistää uudelleen", "ProviderValue": "Tarjoaja: {0}", "Plugin": "Liitännäinen", "NotificationOptionVideoPlaybackStopped": "Videon toisto pysäytetty", - "NotificationOptionVideoPlayback": "Videon toisto aloitettu", - "NotificationOptionUserLockedOut": "Käyttäjä lukittu", + "NotificationOptionVideoPlayback": "Videota toistetaan", + "NotificationOptionUserLockedOut": "Käyttäjä kirjautui ulos", "NotificationOptionTaskFailed": "Ajastettu tehtävä epäonnistui", - "NotificationOptionServerRestartRequired": "Palvelimen uudelleenkäynnistys vaaditaan", - "NotificationOptionPluginUpdateInstalled": "Lisäosan päivitys asennettu", + "NotificationOptionServerRestartRequired": "Palvelin pitää käynnistää uudelleen", + "NotificationOptionPluginUpdateInstalled": "Liitännäinen päivitetty", "NotificationOptionPluginUninstalled": "Liitännäinen poistettu", "NotificationOptionPluginInstalled": "Liitännäinen asennettu", "NotificationOptionPluginError": "Ongelma liitännäisessä", @@ -90,8 +90,8 @@ "NotificationOptionCameraImageUploaded": "Kameran kuva ladattu", "NotificationOptionAudioPlaybackStopped": "Äänen toisto lopetettu", "NotificationOptionAudioPlayback": "Toistetaan ääntä", - "NotificationOptionApplicationUpdateInstalled": "Uusi sovellusversio asennettu", - "NotificationOptionApplicationUpdateAvailable": "Sovelluksesta on uusi versio saatavilla", + "NotificationOptionApplicationUpdateInstalled": "Sovelluspäivitys asennettu", + "NotificationOptionApplicationUpdateAvailable": "Ohjelmistopäivitys saatavilla", "TasksMaintenanceCategory": "Ylläpito", "TaskDownloadMissingSubtitlesDescription": "Etsii puuttuvia tekstityksiä videon metadatatietojen pohjalta.", "TaskDownloadMissingSubtitles": "Lataa puuttuvat tekstitykset", From 9265b422f70cdb1e87a165623fcde66ce6681368 Mon Sep 17 00:00:00 2001 From: Aragon Date: Fri, 1 May 2020 09:24:55 +0000 Subject: [PATCH 113/115] Translated using Weblate (Hebrew) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/he/ --- Emby.Server.Implementations/Localization/Core/he.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/Localization/Core/he.json b/Emby.Server.Implementations/Localization/Core/he.json index 2662913621..8abe31d2a0 100644 --- a/Emby.Server.Implementations/Localization/Core/he.json +++ b/Emby.Server.Implementations/Localization/Core/he.json @@ -62,7 +62,7 @@ "NotificationOptionVideoPlayback": "Video playback started", "NotificationOptionVideoPlaybackStopped": "Video playback stopped", "Photos": "תמונות", - "Playlists": "רשימות ניגון", + "Playlists": "רשימות הפעלה", "Plugin": "Plugin", "PluginInstalledWithName": "{0} was installed", "PluginUninstalledWithName": "{0} was uninstalled", From 62e251663fce8216cea529f85382299ac2f39fbc Mon Sep 17 00:00:00 2001 From: Heikki Jetsonen Date: Fri, 1 May 2020 14:43:54 +0000 Subject: [PATCH 114/115] Translated using Weblate (Finnish) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/fi/ --- Emby.Server.Implementations/Localization/Core/fi.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Emby.Server.Implementations/Localization/Core/fi.json b/Emby.Server.Implementations/Localization/Core/fi.json index 4ed7b301a8..f8d6e0e09b 100644 --- a/Emby.Server.Implementations/Localization/Core/fi.json +++ b/Emby.Server.Implementations/Localization/Core/fi.json @@ -12,7 +12,7 @@ "MessageNamedServerConfigurationUpdatedWithValue": "Palvelimen asetusryhmä {0} on päivitetty", "MessageApplicationUpdatedTo": "Jellyfin palvelin on päivitetty versioon {0}", "MessageApplicationUpdated": "Jellyfin palvelin on päivitetty", - "Latest": "Viimeisin", + "Latest": "Uusimmat", "LabelRunningTimeValue": "Toiston kesto: {0}", "LabelIpAddressValue": "IP-osoite: {0}", "ItemRemovedWithName": "{0} poistettiin kirjastosta", @@ -41,7 +41,7 @@ "CameraImageUploadedFrom": "Uusi kamerakuva on ladattu {0}", "Books": "Kirjat", "AuthenticationSucceededWithUserName": "{0} todennus onnistui", - "Artists": "Esiintyjät", + "Artists": "Artistit", "Application": "Sovellus", "AppDeviceValues": "Sovellus: {0}, Laite: {1}", "Albums": "Albumit", From daf79b8aeb0e202a6bd71e8a65cd24b42f329210 Mon Sep 17 00:00:00 2001 From: Mark Monteiro Date: Sat, 2 May 2020 15:44:24 -0400 Subject: [PATCH 115/115] Do not double dispose write lock and connection in user data repository --- .../Data/SqliteUserDataRepository.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs index 22955850ab..6ee6230fc6 100644 --- a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs @@ -375,5 +375,15 @@ namespace Emby.Server.Implementations.Data return userData; } + + /// + /// + /// There is nothing to dispose here since and + /// are managed by . + /// See . + /// + protected override void Dispose(bool dispose) + { + } } }