Skip to content

Commit

Permalink
Emby server: adjust module options to match changes
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Dec 23, 2024
1 parent a0d0db9 commit 9ed70ab
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 31 deletions.
Binary file added tools/include/images/MED003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions tools/include/markdown/MED003-footer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
=== "Access to the web interface"

The web interface is accessible via port **8096**:

- URL: `https://<your.IP>:8096`

=== "Directories"

- Install directory: `/armbian/emby`
- Site configuration directory: `/armbian/emby/config`
- Data directory: `/armbian/emby/tvshows` `/armbian/emby/movies`

=== "View logs"

```sh
docker logs -f emby
```
1 change: 1 addition & 0 deletions tools/include/markdown/MED003-header.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Emby organizes video, music, live TV, and photos from personal media libraries and streams them to smart TVs, streaming boxes and mobile devices. This container is packaged as a standalone emby Media Server.
22 changes: 16 additions & 6 deletions tools/json/config.software.json
Original file line number Diff line number Diff line change
Expand Up @@ -993,25 +993,35 @@
},
{
"id": "MED003",
"description": "Install Emby server",
"description": "Emby server Install",
"about": "This operation will install Emby server.",
"command": [
"install_embyserver"
"module_emby install"
],
"status": "Stable",
"author": "@schwar3kat",
"condition": "! pkg_installed emby-server"
"condition": "! module_emby status"
},
{
"id": "MED004",
"description": "Remove Emby server",
"description": "Emby server Remove",
"about": "This operation will purge Emby server.",
"command": [
"pkg_remove emby-server"
"module_emby remove"
],
"status": "Stable",
"author": "@schwar3kat",
"condition": "pkg_installed emby-server"
"condition": "module_emby status"
},
{
"id": "MED005",
"description": "Emby server Purge data folder",
"command": [
"module_emby purge"
],
"status": "Stable",
"author": "@igorpecovnik",
"condition": "! module_emby status && [[ -d \"${SOFTWARE_FOLDER}/emby\" ]]"
},
{
"id": "MED010",
Expand Down
1 change: 1 addition & 0 deletions tools/modules/runtime/config.runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ update_sub_submenu_data "System" "Storage" "SY221" "$(module_zfs zfs_installed_v
update_sub_submenu_data "System" "Storage" "NFS04" "$NFS_CLIENTS_NUMBER"
update_sub_submenu_data "Software" "Database" "DAT002" "Server: $LOCALIPADD"
update_sub_submenu_data "Software" "Database" "DAT006" "http://$LOCALIPADD:${module_options["module_phpmyadmin,port"]}"
update_sub_submenu_data "Software" "Media" "MED004" "http://$LOCALIPADD:${module_options["module_emby,port"]}"
update_sub_submenu_data "Software" "Media" "MED006" "http://$LOCALIPADD:${module_options["module_stirling,port"]}"
update_sub_submenu_data "Software" "Media" "MED016" "http://$LOCALIPADD:${module_options["module_syncthing,port"]}"
update_sub_submenu_data "Software" "Media" "MED021" "https://$LOCALIPADD:${module_options["module_nextcloud,port"]}"
Expand Down
23 changes: 0 additions & 23 deletions tools/modules/software/install_embyserver.sh

This file was deleted.

2 changes: 1 addition & 1 deletion tools/modules/software/module_bazarr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function module_bazarr () {
--net=lsio \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Etc/UTC \
-e TZ="$(cat /etc/timezone)" \
-p 6767:6767 \
-v "${BAZARR_BASE}/config:/config" \
-v "${BAZARR_BASE}/movies:/movies" `#optional` \
Expand Down
2 changes: 1 addition & 1 deletion tools/modules/software/module_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function module_docker() {
else
return 1
fi
fi
fi
;;
"${commands[4]}")
echo -e "\nUsage: ${module_options["module_docker,feature"]} <command>"
Expand Down
86 changes: 86 additions & 0 deletions tools/modules/software/module_embyserver.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
module_options+=(
["module_emby,author"]="@schwar3kat"
["module_emby,maintainer"]="@igorpecovnik"
["module_emby,feature"]="module_emby"
["module_emby,example"]="install remove purge status help"
["module_emby,desc"]="Install embyserver container"
["module_emby,status"]="Active"
["module_emby,doc_link"]="https://emby.media"
["module_emby,group"]="Media"
["module_emby,port"]="8096"
["module_emby,arch"]="x86-64 arm64"
)
#
# Module Emby server
#
function module_emby () {
local title="emby"
local condition=$(which "$title" 2>/dev/null)

if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/emby?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/emby?( |$)/{print $3}')
fi

local commands
IFS=' ' read -r -a commands <<< "${module_options["module_emby,example"]}"

EMBY_BASE="${SOFTWARE_FOLDER}/emby"

case "$1" in
"${commands[0]}")
pkg_installed docker-ce || module_docker install
[[ -d "$EMBY_BASE" ]] || mkdir -p "$EMBY_BASE" || { echo "Couldn't create storage directory: $EMBY_BASE"; exit 1; }
docker run -d \
--name=emby \
--net=lsio \
-e PUID=1000 \
-e PGID=1000 \
-e TZ="$(cat /etc/timezone)" \
-p 8096:8096 \
-v "${EMBY_BASE}/emby/library:/config" \
-v "${EMBY_BASE}/movies:/movies" \
-v "${EMBY_BASE}/tvshows:/tvshows" \
--restart unless-stopped \
lscr.io/linuxserver/emby:latest
for i in $(seq 1 20); do
if docker inspect -f '{{ index .Config.Labels "build_version" }}' emby >/dev/null 2>&1 ; then
break
else
sleep 3
fi
if [ $i -eq 20 ] ; then
echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs emby\`)"
exit 1
fi
done
;;
"${commands[1]}")
[[ "${container}" ]] && docker container rm -f "$container" >/dev/null
[[ "${image}" ]] && docker image rm "$image" >/dev/null
;;
"${commands[2]}")
[[ -n "${EMBY_BASE}" && "${EMBY_BASE}" != "/" ]] && rm -rf "${EMBY_BASE}"
;;
"${commands[3]}")
if [[ "${container}" && "${image}" ]]; then
return 0
else
return 1
fi
;;
"${commands[4]}")
echo -e "\nUsage: ${module_options["module_embyserver,feature"]} <command>"
echo -e "Commands: ${module_options["module_embyserver,example"]}"
echo "Available commands:"
echo -e "\tinstall\t- Install $title."
echo -e "\tstatus\t- Installation status $title."
echo -e "\tremove\t- Remove $title."
echo -e "\tremove\t- Purge $title."
echo
;;
*)
${module_options["module_embyserver,feature"]} ${commands[4]}
;;
esac
}

0 comments on commit 9ed70ab

Please sign in to comment.