kodiPlugins.yatp: init at 3.3.2

This commit is contained in:
Jan Malakhovski 2018-09-06 19:40:28 +00:00 committed by Frederik Rietdijk
parent 607c6e78e7
commit e220331903
2 changed files with 58 additions and 1 deletions

View File

@ -1,6 +1,7 @@
{ stdenv, callPackage, fetchurl, fetchFromGitHub, unzip
, cmake, kodiPlain, libcec_platform, tinyxml
, steam, libusb, pcre-cpp, jsoncpp, libhdhomerun, zlib }:
, steam, libusb, pcre-cpp, jsoncpp, libhdhomerun, zlib
, python2Packages }:
with stdenv.lib;
@ -462,4 +463,31 @@ let self = rec {
};
};
yatp = python2Packages.toPythonModule (mkKodiPlugin rec {
plugin = "yatp";
namespace = "plugin.video.yatp";
version = "3.3.2";
src = fetchFromGitHub {
owner = "romanvm";
repo = "kodi.yatp";
rev = "v.${version}";
sha256 = "12g1f57sx7dy6wy7ljl7siz2qs1kxcmijcg7xx2xpvmq61x9qa2d";
};
patches = [ ./yatp/dont-monkey.patch ];
propagatedBuildInputs = [
simpleplugin
python2Packages.requests
python2Packages.libtorrentRasterbar
];
meta = {
homepage = src.meta.homepage;
description = "Yet Another Torrent Player: libtorrent-based torrent streaming for Kodi";
license = licenses.gpl3;
};
});
}; in self

View File

@ -0,0 +1,29 @@
diff --git a/plugin.video.yatp/server.py b/plugin.video.yatp/server.py
index 1adcbb5..488b72c 100644
--- a/plugin.video.yatp/server.py
+++ b/plugin.video.yatp/server.py
@@ -20,24 +20,8 @@ addon = Addon()
_ = addon.initialize_gettext()
addon.log_notice('Starting Torrent Server...')
-# A monkey-patch to set the necessary librorrent version
-librorrent_addon = Addon('script.module.libtorrent')
-orig_custom_version = librorrent_addon.get_setting('custom_version', False)
-orig_set_version = librorrent_addon.get_setting('set_version', False)
-librorrent_addon.set_setting('custom_version', 'true')
-if addon.libtorrent_version == '1.0.9':
- librorrent_addon.set_setting('set_version', '4')
-elif addon.libtorrent_version == '1.1.0':
- librorrent_addon.set_setting('set_version', '5')
-elif addon.libtorrent_version == '1.1.1':
- librorrent_addon.set_setting('set_version', '6')
-else:
- librorrent_addon.set_setting('set_version', '0')
-
from libs.server import wsgi_app
-librorrent_addon.set_setting('custom_version', orig_custom_version)
-librorrent_addon.set_setting('set_version', orig_set_version)
# ======
if addon.enable_limits: