mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
emby4: initial addon
This commit is contained in:
parent
84c634a8ce
commit
ba50b7b19c
2
packages/addons/service/emby4/changelog.txt
Normal file
2
packages/addons/service/emby4/changelog.txt
Normal file
@ -0,0 +1,2 @@
|
||||
100
|
||||
- Initial release
|
BIN
packages/addons/service/emby4/icon/icon.png
Normal file
BIN
packages/addons/service/emby4/icon/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
35
packages/addons/service/emby4/package.mk
Normal file
35
packages/addons/service/emby4/package.mk
Normal file
@ -0,0 +1,35 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
PKG_NAME="emby4"
|
||||
PKG_VERSION="4.0.0.2"
|
||||
PKG_SHA256="cac3de0f4b75d421719676377bae80274338a493e79c0498c8772e7e51cd8edf"
|
||||
PKG_REV="100"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="prop."
|
||||
PKG_SITE="http://emby.media"
|
||||
PKG_URL="https://github.com/MediaBrowser/Emby.Releases/releases/download/$PKG_VERSION/embyserver-netcore_$PKG_VERSION.zip"
|
||||
PKG_SOURCE_DIR="system"
|
||||
PKG_DEPENDS_TARGET="toolchain imagemagick"
|
||||
PKG_SECTION="service"
|
||||
PKG_SHORTDESC="Emby Server: a personal media server"
|
||||
PKG_LONGDESC="Emby Server ($PKG_VERSION) brings your home videos, music, and photos together, automatically converting and streaming your media on-the-fly to any device"
|
||||
PKG_TOOLCHAIN="manual"
|
||||
|
||||
PKG_IS_ADDON="yes"
|
||||
PKG_ADDON_NAME="Emby Server 4"
|
||||
PKG_ADDON_TYPE="xbmc.service"
|
||||
PKG_ADDON_REQUIRES="tools.ffmpeg-tools:0.0.0 tools.dotnet-runtime:0.0.0"
|
||||
PKG_MAINTAINER="Anton Voyl (awiouy)"
|
||||
|
||||
addon() {
|
||||
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/emby
|
||||
cp -r $PKG_BUILD/* \
|
||||
-d $ADDON_BUILD/$PKG_ADDON_ID/emby
|
||||
|
||||
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/lib
|
||||
cp -L $(get_build_dir imagemagick)/.install_pkg/usr/lib/libMagickCore-7.Q16HDRI.so.? \
|
||||
$ADDON_BUILD/$PKG_ADDON_ID/lib/
|
||||
cp -L $(get_build_dir imagemagick)/.install_pkg/usr/lib/libMagickWand-7.Q16HDRI.so \
|
||||
$ADDON_BUILD/$PKG_ADDON_ID/lib/CORE_RL_Wand_.so
|
||||
}
|
15
packages/addons/service/emby4/source/bin/emby4.start
Normal file
15
packages/addons/service/emby4/source/bin/emby4.start
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
. /etc/profile
|
||||
oe_setup_addon service.emby4
|
||||
|
||||
LD_PRELOAD="$ADDON_DIR/lib/libMagickCore-7.Q16HDRI.so.6 \
|
||||
$ADDON_DIR/lib/CORE_RL_Wand_.so" \
|
||||
nice -n "$emby_nice" \
|
||||
le_dotnet $ADDON_DIR/emby/EmbyServer.dll \
|
||||
-programdata $ADDON_HOME \
|
||||
-ffmpeg /storage/.kodi/addons/tools.ffmpeg-tools/bin/ffmpeg \
|
||||
-ffprobe /storage/.kodi/addons/tools.ffmpeg-tools/bin/ffprobe
|
46
packages/addons/service/emby4/source/default.py
Normal file
46
packages/addons/service/emby4/source/default.py
Normal file
@ -0,0 +1,46 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
import json
|
||||
import subprocess
|
||||
import xbmc
|
||||
import xbmcaddon
|
||||
import xbmcgui
|
||||
|
||||
|
||||
def jsonrpc(request):
|
||||
return json.loads(xbmc.executeJSONRPC(json.dumps(request)))
|
||||
|
||||
|
||||
def disable_conflicting(conficting,
|
||||
message='{that} conflicts with {this} and has been disabled'):
|
||||
is_enabled = {'jsonrpc': '2.0', 'method': 'Addons.GetAddonDetails', 'id': 1,
|
||||
'params': {'addonid': conficting, 'properties': ['enabled']}}
|
||||
disable = {'jsonrpc': '2.0', 'method': 'Addons.SetAddonEnabled', 'id': 1,
|
||||
'params': {'addonid': conficting, 'enabled': False}}
|
||||
try:
|
||||
if jsonrpc(is_enabled)['result']['addon']['enabled']:
|
||||
this = xbmcaddon.Addon().getAddonInfo('name')
|
||||
that = xbmcaddon.Addon(conficting).getAddonInfo('name')
|
||||
jsonrpc(disable)
|
||||
dialog = xbmcgui.Dialog()
|
||||
dialog.ok(this, message.format(
|
||||
this=this, that=that))
|
||||
del dialog
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
|
||||
class Monitor(xbmc.Monitor):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
xbmc.Monitor.__init__(self)
|
||||
self.id = xbmcaddon.Addon().getAddonInfo('id')
|
||||
|
||||
def onSettingsChanged(self):
|
||||
subprocess.call(['systemctl', 'restart', self.id])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
disable_conflicting('service.emby')
|
||||
Monitor().waitForAbort()
|
@ -0,0 +1,14 @@
|
||||
# Kodi Media Center language file
|
||||
# Addon Name: emby4
|
||||
# Addon id: service.emby4
|
||||
# Addon Provider: Team LibreELEC
|
||||
msgid ""
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#30000"
|
||||
msgid "Configuration"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#30001"
|
||||
msgid "Priority (nice, 0=max, 19=min)"
|
||||
msgstr ""
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<settings>
|
||||
<category label="30000">
|
||||
<setting label="30001" id="emby_nice" type="slider" default="10" range="0,1,19" option="int" />
|
||||
</category>
|
||||
</settings>
|
@ -0,0 +1,3 @@
|
||||
<settings version="2">
|
||||
<setting id="emby_nice" default="true">10</setting>
|
||||
</settings>
|
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Emby 4 - streaming server
|
||||
Documentation=http://emby.media
|
||||
Wants=kodi.service
|
||||
After=kodi.service
|
||||
Conflicts=service.emby.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/bin/sh /storage/.kodi/addons/service.emby4/bin/emby4.start
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=kodi.service
|
Loading…
x
Reference in New Issue
Block a user