fix msx build and some changes

This commit is contained in:
YouROK
2021-09-20 17:36:17 +03:00
parent bb2993dbf4
commit c95bfa7e68
14 changed files with 83 additions and 177 deletions

View File

@@ -28,7 +28,6 @@ func main() {
run("rm", "-rf", srcGo+"template/pages")
run("cp", "-r", compileHtml, srcGo+"template/pages")
run("cp", "-r", "server/web/msx/pages", srcGo+"template/pages/msx")
files := make([]string, 0)

View File

@@ -19,6 +19,7 @@ require (
github.com/gin-gonic/gin v1.7.4
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.7.0
go.etcd.io/bbolt v1.3.6
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac
)
@@ -57,6 +58,7 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rs/dnscache v0.0.0-20210201191234-295bba877686 // indirect
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
@@ -70,4 +72,5 @@ require (
golang.org/x/text v0.3.6 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

12
server/web/msx/html.go Normal file
View File

@@ -0,0 +1,12 @@
package msx
import _ "embed"
//go:embed pages/tizen.html
var Msxtizenhtml []byte
//go:embed pages/tizen.js
var Msxtizenjs []byte
//go:embed pages/tvx-plugin.min.js
var Msxtvxpluginminjs []byte

View File

@@ -84,8 +84,8 @@ func msxTorrents(c *gin.Context) {
for i, tor := range torrs {
item := msxItem{
Title: tor.Title,
Image: tor.Poster,
Title: tor.Title,
Image: tor.Poster,
Action: "content:" + host + "/msx/playlist/" + url.PathEscape(tor.Title) +
"?hash=" + tor.TorrentSpec.InfoHash.HexString() + "&platform={PLATFORM}",
}
@@ -189,31 +189,31 @@ func msxPlaylist(c *gin.Context) {
Action: action + ":" + uri,
}
if (platform == "android" || platform == "firetv") {
if platform == "android" || platform == "firetv" {
item.Action = "system:tvx:launch"
item.Data = gin.H{
"id": hash + "-" + fmt.Sprint(f.Id),
"uri": uri,
"id": hash + "-" + fmt.Sprint(f.Id),
"uri": uri,
"type": mime,
}
} else if (platform == "lg") {
} else if platform == "lg" {
// TODO - custom player needed
// item.Action = "system:lg:launch:com.webos.app.mediadiscovery"
// item.Data = gin.H{
// "properties": gin.H{
// "videoList": gin.H{
// "result": [1]gin.H{
// gin.H{
// "url": uri,
// "thumbnail": tor.Poster,
// },
// },
// },
// },
// }
} else if (platform == "ios" || platform == "mac") {
//item.Action = "system:lg:launch:com.webos.app.mediadiscovery"
//item.Data = gin.H{
// "properties": gin.H{
// "videoList": gin.H{
// "result": [1]gin.H{
// gin.H{
// "url": uri,
// "thumbnail": tor.Poster,
// },
// },
// },
// },
//}
} else if platform == "ios" || platform == "mac" {
// TODO - for iOS and Mac the application must be defined in scheme but we don't know what user has installed
// item.Action = "system:tvx:launch:vlc://"+uri
item.Action = "system:tvx:launch:vlc://" + uri
}
if isViewed(viewed, f.Id) {
@@ -247,14 +247,14 @@ func msxPlaylist(c *gin.Context) {
Items: list,
}
if (platform == "tizen") {
if platform == "tizen" {
res.Template.Properties = gin.H{
"button:content:icon": "tune",
"button:content:icon": "tune",
"button:content:action": "content:request:interaction:init@" + host + "/msx/tizen.html",
}
} else if (platform == "netcast") {
} else if platform == "netcast" {
res.Template.Properties = gin.H{
"button:content:icon": "tune",
"button:content:icon": "tune",
"button:content:action": "system:netcast:menu",
}
}

View File

@@ -7,4 +7,16 @@ func SetupRoute(route *gin.RouterGroup) {
route.GET("/msx/torrents", msxTorrents)
route.GET("/msx/playlist", msxPlaylist)
route.GET("/msx/playlist/*fname", msxPlaylist)
route.GET("/msx/tizen.html", func(c *gin.Context) {
c.Data(200, "text/html; charset=utf-8", Msxtizenhtml)
})
route.GET("/msx/tizen.js", func(c *gin.Context) {
c.Data(200, "text/javascript; charset=utf-8", Msxtizenjs)
})
route.GET("/msx/tvx-plugin.min.js", func(c *gin.Context) {
c.Data(200, "text/javascript; charset=utf-8", Msxtvxpluginminjs)
})
}

View File

@@ -46,32 +46,23 @@ var Indexhtml []byte
//go:embed pages/mstile-150x150.png
var Mstile150x150png []byte
//go:embed pages/msx/tizen.html
var Msxtizenhtml []byte
//go:embed pages/msx/tizen.js
var Msxtizenjs []byte
//go:embed pages/msx/tvx-plugin.min.js
var Msxtvxpluginminjs []byte
//go:embed pages/site.webmanifest
var Sitewebmanifest []byte
//go:embed pages/static/js/2.74a4e2cb.chunk.js
var Staticjs274a4e2cbchunkjs []byte
//go:embed pages/static/js/2.91c8cd38.chunk.js
var Staticjs291c8cd38chunkjs []byte
//go:embed pages/static/js/2.74a4e2cb.chunk.js.LICENSE.txt
var Staticjs274a4e2cbchunkjsLICENSEtxt []byte
//go:embed pages/static/js/2.91c8cd38.chunk.js.LICENSE.txt
var Staticjs291c8cd38chunkjsLICENSEtxt []byte
//go:embed pages/static/js/2.74a4e2cb.chunk.js.map
var Staticjs274a4e2cbchunkjsmap []byte
//go:embed pages/static/js/2.91c8cd38.chunk.js.map
var Staticjs291c8cd38chunkjsmap []byte
//go:embed pages/static/js/main.72a47914.chunk.js
var Staticjsmain72a47914chunkjs []byte
//go:embed pages/static/js/main.26d1f79c.chunk.js
var Staticjsmain26d1f79cchunkjs []byte
//go:embed pages/static/js/main.72a47914.chunk.js.map
var Staticjsmain72a47914chunkjsmap []byte
//go:embed pages/static/js/main.26d1f79c.chunk.js.map
var Staticjsmain26d1f79cchunkjsmap []byte
//go:embed pages/static/js/runtime-main.33603a80.js
var Staticjsruntimemain33603a80js []byte

View File

@@ -1,17 +1,17 @@
{
"files": {
"main.js": "/static/js/main.72a47914.chunk.js",
"main.js.map": "/static/js/main.72a47914.chunk.js.map",
"main.js": "/static/js/main.26d1f79c.chunk.js",
"main.js.map": "/static/js/main.26d1f79c.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.33603a80.js",
"runtime-main.js.map": "/static/js/runtime-main.33603a80.js.map",
"static/js/2.74a4e2cb.chunk.js": "/static/js/2.74a4e2cb.chunk.js",
"static/js/2.74a4e2cb.chunk.js.map": "/static/js/2.74a4e2cb.chunk.js.map",
"static/js/2.91c8cd38.chunk.js": "/static/js/2.91c8cd38.chunk.js",
"static/js/2.91c8cd38.chunk.js.map": "/static/js/2.91c8cd38.chunk.js.map",
"index.html": "/index.html",
"static/js/2.74a4e2cb.chunk.js.LICENSE.txt": "/static/js/2.74a4e2cb.chunk.js.LICENSE.txt"
"static/js/2.91c8cd38.chunk.js.LICENSE.txt": "/static/js/2.91c8cd38.chunk.js.LICENSE.txt"
},
"entrypoints": [
"static/js/runtime-main.33603a80.js",
"static/js/2.74a4e2cb.chunk.js",
"static/js/main.72a47914.chunk.js"
"static/js/2.91c8cd38.chunk.js",
"static/js/main.26d1f79c.chunk.js"
]
}

View File

@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"><link rel="manifest" href="/site.webmanifest"><meta name="msapplication-TileColor" content="#00a572"><meta name="theme-color" content="#ffffff"><link rel="preconnect" href="https://fonts.gstatic.com"><link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600&display=swap" rel="stylesheet"><meta name="viewport" content="width=device-width,shrink-to-fit=no"><meta name="description" content="TorrServer - torrent to http stream"/><title>TorrServer MatriX</title></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="https://cdn.lordicon.com/libs/frhvbuzj/lord-icon-2.0.2.js"></script><script src="https://www.gstatic.com/firebasejs/8.1.2/firebase-app.js"></script><script src="https://www.gstatic.com/firebasejs/8.1.2/firebase-analytics.js"></script><script>const firebaseConfig={apiKey:"AIzaSyDivIsadtzAmp3SIY4yArNcFugUmr63rvo",authDomain:"torrserve.firebaseapp.com",databaseURL:"https://torrserve.firebaseio.com",projectId:"torrserve",storageBucket:"torrserve.appspot.com",messagingSenderId:"400168070412",appId:"1:400168070412:web:82c8e43dd7fc8f807aed29",measurementId:"G-T4RC2BFRSF"};firebase.initializeApp(firebaseConfig),firebase.analytics()</script><script>!function(e){function r(r){for(var n,l,f=r[0],i=r[1],a=r[2],c=0,s=[];c<f.length;c++)l=f[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,f=1;f<t.length;f++){var i=t[f];0!==o[i]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var f=this.webpackJsonptorrserver_web=this.webpackJsonptorrserver_web||[],i=f.push.bind(f);f.push=r,f=f.slice();for(var a=0;a<f.length;a++)r(f[a]);var p=i;t()}([])</script><script src="/static/js/2.74a4e2cb.chunk.js"></script><script src="/static/js/main.72a47914.chunk.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"><link rel="manifest" href="/site.webmanifest"><meta name="msapplication-TileColor" content="#00a572"><meta name="theme-color" content="#ffffff"><link rel="preconnect" href="https://fonts.gstatic.com"><link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600&display=swap" rel="stylesheet"><meta name="viewport" content="width=device-width,shrink-to-fit=no"><meta name="description" content="TorrServer - torrent to http stream"/><title>TorrServer MatriX</title></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="https://cdn.lordicon.com/libs/frhvbuzj/lord-icon-2.0.2.js"></script><script src="https://www.gstatic.com/firebasejs/8.1.2/firebase-app.js"></script><script src="https://www.gstatic.com/firebasejs/8.1.2/firebase-analytics.js"></script><script>const firebaseConfig={apiKey:"AIzaSyDivIsadtzAmp3SIY4yArNcFugUmr63rvo",authDomain:"torrserve.firebaseapp.com",databaseURL:"https://torrserve.firebaseio.com",projectId:"torrserve",storageBucket:"torrserve.appspot.com",messagingSenderId:"400168070412",appId:"1:400168070412:web:82c8e43dd7fc8f807aed29",measurementId:"G-T4RC2BFRSF"};firebase.initializeApp(firebaseConfig),firebase.analytics()</script><script>!function(e){function r(r){for(var n,l,f=r[0],i=r[1],a=r[2],c=0,s=[];c<f.length;c++)l=f[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,f=1;f<t.length;f++){var i=t[f];0!==o[i]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var f=this.webpackJsonptorrserver_web=this.webpackJsonptorrserver_web||[],i=f.push.bind(f);f.push=r,f=f.slice();for(var a=0;a<f.length;a++)r(f[a]);var p=i;t()}([])</script><script src="/static/js/2.91c8cd38.chunk.js"></script><script src="/static/js/main.26d1f79c.chunk.js"></script></body></html>

File diff suppressed because one or more lines are too long

View File

@@ -1,92 +0,0 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
/*! blob-to-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
/*! https://mths.be/punycode v1.4.1 by @mathias */
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
/*! magnet-uri. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
/*! parse-torrent. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
/*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
/*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
/**
* A better abstraction over CSS.
*
* @copyright Oleg Isonen (Slobodskoi) / Isonen 2014-present
* @website https://github.com/cssinjs/jss
* @license MIT
*/
/** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -26,7 +26,7 @@ func RouteWebPages(route *gin.RouterGroup) {
})
route.GET("/browserconfig.xml", func(c *gin.Context) {
c.Data(200, "application/xml", Browserconfigxml)
c.Data(200, "text/xml; charset=utf-8", Browserconfigxml)
})
route.GET("/dlnaicon-120.jpg", func(c *gin.Context) {
@@ -54,7 +54,7 @@ func RouteWebPages(route *gin.RouterGroup) {
})
route.GET("/favicon.ico", func(c *gin.Context) {
c.Data(200, "image/x-icon", Faviconico)
c.Data(200, "image/vnd.microsoft.icon", Faviconico)
})
route.GET("/index.html", func(c *gin.Context) {
@@ -65,44 +65,32 @@ func RouteWebPages(route *gin.RouterGroup) {
c.Data(200, "image/png", Mstile150x150png)
})
route.GET("/msx/tizen.html", func(c *gin.Context) {
c.Data(200, "text/html; charset=utf-8", Msxtizenhtml)
})
route.GET("/msx/tizen.js", func(c *gin.Context) {
c.Data(200, "application/javascript", Msxtizenjs)
})
route.GET("/msx/tvx-plugin.min.js", func(c *gin.Context) {
c.Data(200, "application/javascript", Msxtvxpluginminjs)
})
route.GET("/site.webmanifest", func(c *gin.Context) {
c.Data(200, "application/manifest+json", Sitewebmanifest)
})
route.GET("/static/js/2.74a4e2cb.chunk.js", func(c *gin.Context) {
c.Data(200, "application/javascript", Staticjs274a4e2cbchunkjs)
route.GET("/static/js/2.91c8cd38.chunk.js", func(c *gin.Context) {
c.Data(200, "text/javascript; charset=utf-8", Staticjs291c8cd38chunkjs)
})
route.GET("/static/js/2.74a4e2cb.chunk.js.LICENSE.txt", func(c *gin.Context) {
c.Data(200, "text/plain; charset=utf-8", Staticjs274a4e2cbchunkjsLICENSEtxt)
route.GET("/static/js/2.91c8cd38.chunk.js.LICENSE.txt", func(c *gin.Context) {
c.Data(200, "text/plain; charset=utf-8", Staticjs291c8cd38chunkjsLICENSEtxt)
})
route.GET("/static/js/2.74a4e2cb.chunk.js.map", func(c *gin.Context) {
c.Data(200, "application/json", Staticjs274a4e2cbchunkjsmap)
route.GET("/static/js/2.91c8cd38.chunk.js.map", func(c *gin.Context) {
c.Data(200, "application/json", Staticjs291c8cd38chunkjsmap)
})
route.GET("/static/js/main.72a47914.chunk.js", func(c *gin.Context) {
c.Data(200, "application/javascript", Staticjsmain72a47914chunkjs)
route.GET("/static/js/main.26d1f79c.chunk.js", func(c *gin.Context) {
c.Data(200, "text/javascript; charset=utf-8", Staticjsmain26d1f79cchunkjs)
})
route.GET("/static/js/main.72a47914.chunk.js.map", func(c *gin.Context) {
c.Data(200, "application/json", Staticjsmain72a47914chunkjsmap)
route.GET("/static/js/main.26d1f79c.chunk.js.map", func(c *gin.Context) {
c.Data(200, "application/json", Staticjsmain26d1f79cchunkjsmap)
})
route.GET("/static/js/runtime-main.33603a80.js", func(c *gin.Context) {
c.Data(200, "application/javascript", Staticjsruntimemain33603a80js)
c.Data(200, "text/javascript; charset=utf-8", Staticjsruntimemain33603a80js)
})
route.GET("/static/js/runtime-main.33603a80.js.map", func(c *gin.Context) {