2 lines
No EOL
49 KiB
JavaScript
2 lines
No EOL
49 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-abbc1cdc","chunk-fa20b8a0"],{"00a9":function(e,t,n){"use strict";n("f279")},"0bc6":function(e,t,n){"use strict";n("9894")},"2b05":function(e,t,n){},"2ca0":function(e,t,n){"use strict";var r=n("23e7"),a=n("06cf").f,i=n("50c4"),s=n("5a34"),c=n("1d80"),l=n("ab13"),u=n("c430"),o="".startsWith,d=Math.min,b=l("startsWith"),f=!u&&!b&&!!function(){var e=a(String.prototype,"startsWith");return e&&!e.writable}();r({target:"String",proto:!0,forced:!f&&!b},{startsWith:function(e){var t=String(c(this));s(e);var n=i(d(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return o?o.call(t,r,n):t.slice(n,n+r.length)===r}})},3627:function(e,t,n){},3951:function(e,t,n){"use strict";n.r(t);n("ac1f"),n("841c");var r=n("7a23"),a=Object(r["K"])("data-v-3055ba65");Object(r["u"])("data-v-3055ba65");var i={class:"media-plugin fade-in"},s={class:"nav-container"},c={class:"view-container"},l={class:"media-info-container"},u={class:"subtitles-container"},o={key:0,class:"subtitles-content"},d={class:"play-url-container"},b={class:"row"},f=Object(r["g"])(" Play URL (use "),p=Object(r["g"])("file://"),m=Object(r["g"])(" prefix for local files) "),h={class:"row footer"};Object(r["s"])();var v=a((function(e,t,n,v,O,j){var g,y,w=Object(r["z"])("Loading"),x=Object(r["z"])("Nav"),k=Object(r["z"])("Header"),C=Object(r["z"])("Results"),P=Object(r["z"])("TorrentView"),R=Object(r["z"])("Browser"),S=Object(r["z"])("MediaView"),N=Object(r["z"])("Info"),M=Object(r["z"])("Modal"),I=Object(r["z"])("Subtitles"),$=Object(r["z"])("tt");return Object(r["r"])(),Object(r["e"])(r["b"],null,[Object(r["h"])("div",i,[O.loading?(Object(r["r"])(),Object(r["e"])(w,{key:0})):Object(r["f"])("",!0),Object(r["h"])(S,{"plugin-name":n.pluginName,status:(null===(g=O.selectedPlayer)||void 0===g?void 0:g.status)||{},track:(null===(y=O.selectedPlayer)||void 0===y?void 0:y.status)||{},buttons:n.mediaButtons,onPlay:j.pause,onPause:j.pause,onStop:j.stop,onSetVolume:j.setVolume,onSeek:j.seek,onSearch:j.search},{default:a((function(){var a;return[Object(r["h"])("main",null,[Object(r["h"])("div",s,[Object(r["h"])(x,{"selected-view":O.selectedView,onInput:t[1]||(t[1]=function(e){return O.selectedView=e})},null,8,["selected-view"])]),Object(r["h"])("div",c,[Object(r["h"])(k,{"plugin-name":n.pluginName,"selected-view":O.selectedView,"has-subtitles-plugin":j.hasSubtitlesPlugin,ref:"header",sources:O.sources,"selected-item":O.selectedPlayer&&O.selectedPlayer.status&&("play"===O.selectedPlayer.status.state||"pause"===O.selectedPlayer.status.state)?O.selectedPlayer.status:O.results[O.selectedResult],"selected-subtitles":O.selectedSubtitles,"browser-filter":O.browserFilter,onSearch:j.search,onSelectPlayer:t[2]||(t[2]=function(e){return O.selectedPlayer=e}),onPlayerStatus:j.onStatusUpdate,onTorrentAdd:t[3]||(t[3]=function(e){return j.downloadTorrent(e)}),onShowSubtitles:t[4]||(t[4]=function(e){return O.showSubtitlesModal=!O.showSubtitlesModal}),onPlayUrl:t[5]||(t[5]=function(t){return e.$refs.playUrlModal.show()}),onFilter:t[6]||(t[6]=function(e){return O.browserFilter=e}),onSourceToggle:t[7]||(t[7]=function(e){return O.sources[e]=!O.sources[e]})},null,8,["plugin-name","selected-view","has-subtitles-plugin","sources","selected-item","selected-subtitles","browser-filter","onSearch","onPlayerStatus"]),Object(r["h"])("div",{class:["body-container",{"expanded-header":null===(a=e.$refs.header)||void 0===a?void 0:a.filterVisible}]},["search"===O.selectedView?(Object(r["r"])(),Object(r["e"])(C,{key:0,results:O.results,"selected-result":O.selectedResult,onSelect:t[8]||(t[8]=function(e){return j.onResultSelect(e)}),onPlay:j.play,onInfo:t[9]||(t[9]=function(t){return e.$refs.mediaInfo.isVisible=!0}),onView:j.view,onDownload:j.download,sources:O.sources},null,8,["results","selected-result","onPlay","onView","onDownload","sources"])):"torrents"===O.selectedView?(Object(r["r"])(),Object(r["e"])(P,{key:1,"plugin-name":O.torrentPlugin,"is-media":!0,onPlay:j.play},null,8,["plugin-name","onPlay"])):"browser"===O.selectedView?(Object(r["r"])(),Object(r["e"])(R,{key:2,"plugin-name":O.torrentPlugin,"is-media":!0,filter:O.browserFilter,onPathChange:t[10]||(t[10]=function(e){return O.browserFilter=""}),onPlay:t[11]||(t[11]=function(e){return j.play(e)})},null,8,["plugin-name","filter"])):Object(r["f"])("",!0)],2)])])]})),_:1},8,["plugin-name","status","track","buttons","onPlay","onPause","onStop","onSetVolume","onSeek","onSearch"]),Object(r["h"])("div",l,[Object(r["h"])(M,{title:"Media info",ref:"mediaInfo"},{default:a((function(){return[null!=O.selectedResult?(Object(r["r"])(),Object(r["e"])(N,{key:0,item:O.results[O.selectedResult]},null,8,["item"])):Object(r["f"])("",!0)]})),_:1},512)]),Object(r["h"])("div",u,[Object(r["h"])(M,{title:"Available subtitles",visible:O.showSubtitlesModal,ref:"subtitlesSelector",onClose:t[13]||(t[13]=function(e){return O.showSubtitlesModal=!1})},{default:a((function(){return[O.showSubtitlesModal&&null!=O.selectedResult?(Object(r["r"])(),Object(r["e"])("div",o,[Object(r["h"])(I,{item:O.selectedPlayer&&O.selectedPlayer.status&&("play"===O.selectedPlayer.status.state||"pause"===O.selectedPlayer.status.state)?O.selectedPlayer.status:O.results[O.selectedResult],onSelectSubs:t[12]||(t[12]=function(e){return j.selectSubtitles(e)})},null,8,["item"])])):Object(r["f"])("",!0)]})),_:1},8,["visible"])]),Object(r["h"])("div",d,[Object(r["h"])(M,{title:"Play URL",ref:"playUrlModal",onOpen:t[16]||(t[16]=function(t){return e.$refs.playUrlInput.focus()})},{default:a((function(){var e;return[Object(r["h"])("form",{onSubmit:t[15]||(t[15]=Object(r["J"])((function(e){return j.playUrl(O.urlPlay)}),["prevent"]))},[Object(r["h"])("div",b,[Object(r["h"])("label",null,[f,Object(r["h"])($,null,{default:a((function(){return[p]})),_:1}),m,Object(r["I"])(Object(r["h"])("input",{type:"text","onUpdate:modelValue":t[14]||(t[14]=function(e){return O.urlPlay=e}),ref:"playUrlInput",autofocus:""},null,512),[[r["F"],O.urlPlay]])])]),Object(r["h"])("div",h,[Object(r["h"])("button",{type:"submit",disabled:!(null===(e=O.urlPlay)||void 0===e?void 0:e.length)},"Play",8,["disabled"])])],32)]})),_:1},512)])])],1024)})),O=(n("b0c0"),n("d3b7"),n("6062"),n("3ca3"),n("ddb0"),n("b85c")),j=(n("96cf"),n("1da1")),g=n("3a5e"),y=n("714b"),w=n("3e54"),x=n("18dc"),k=n("7726"),C=(n("b64b"),n("2ca0"),Object(r["K"])("data-v-457d4016"));Object(r["u"])("data-v-457d4016");var P={class:"row"},R={key:0,class:"col-7 left side"},S=Object(r["h"])("i",{class:"fa fa-filter"},null,-1),N={class:"search-box"},M={key:1,class:"col-7 left side"},I={class:"search-box"},$={key:2,class:"col-7 left side"},V={class:"search-box"},q={class:"col-5 right side"},_=Object(r["h"])("i",{class:"fas fa-closed-captioning"},null,-1),T=Object(r["h"])("i",{class:"fa fa-plus-circle"},null,-1);Object(r["s"])();var z=C((function(e,t,n,a,i,s){var c=Object(r["z"])("Players");return Object(r["r"])(),Object(r["e"])("div",{class:["header",{"with-filter":i.filterVisible}]},[Object(r["h"])("div",P,["search"===n.selectedView?(Object(r["r"])(),Object(r["e"])("div",R,[Object(r["h"])("button",{title:"Filter",class:["filter-btn",{selected:i.filterVisible}],onClick:t[1]||(t[1]=function(e){return i.filterVisible=!i.filterVisible})},[S],2),Object(r["h"])("form",{onSubmit:t[3]||(t[3]=Object(r["J"])((function(){return s.search.apply(s,arguments)}),["prevent"]))},[Object(r["h"])("label",N,[Object(r["I"])(Object(r["h"])("input",{type:"search",placeholder:"Search","onUpdate:modelValue":t[2]||(t[2]=function(e){return i.query=e})},null,512),[[r["F"],i.query]])])],32)])):"torrents"===n.selectedView?(Object(r["r"])(),Object(r["e"])("div",M,[Object(r["h"])("form",{onSubmit:t[5]||(t[5]=Object(r["J"])((function(t){return e.$emit("torrent-add",i.torrentURL)}),["prevent"]))},[Object(r["h"])("label",I,[Object(r["I"])(Object(r["h"])("input",{type:"search",placeholder:"Add torrent URL","onUpdate:modelValue":t[4]||(t[4]=function(e){return i.torrentURL=e})},null,512),[[r["F"],i.torrentURL]])])],32)])):"browser"===n.selectedView?(Object(r["r"])(),Object(r["e"])("div",$,[Object(r["h"])("label",V,[Object(r["h"])("input",{type:"search",placeholder:"Filter",value:n.browserFilter,onChange:t[6]||(t[6]=function(t){return e.$emit("filter",t.target.value)}),onKeyup:t[7]||(t[7]=function(t){return e.$emit("filter",t.target.value)})},null,40,["value"])])])):Object(r["f"])("",!0),Object(r["h"])("div",q,[n.hasSubtitlesPlugin&&n.selectedItem&&("file"===n.selectedItem.type||(n.selectedItem.url||"").startsWith("file://"))?(Object(r["r"])(),Object(r["e"])("button",{key:0,title:"Select subtitles",class:["captions-btn",{selected:null!=n.selectedSubtitles}],onClick:t[8]||(t[8]=function(t){return e.$emit("show-subtitles")})},[_],2)):Object(r["f"])("",!0),Object(r["h"])(c,{"plugin-name":n.pluginName,onSelect:t[9]||(t[9]=function(t){return e.$emit("select-player",t)}),onStatus:t[10]||(t[10]=function(t){return e.$emit("player-status",t)})},null,8,["plugin-name"]),Object(r["h"])("button",{title:"Play URL",onClick:t[11]||(t[11]=function(t){return e.$emit("play-url")})},[T])])]),Object(r["h"])("div",{class:["row filter fade-in",{hidden:!i.filterVisible}]},[(Object(r["r"])(!0),Object(r["e"])(r["a"],null,Object(r["x"])(Object.keys(n.sources),(function(t){return Object(r["r"])(),Object(r["e"])("label",{key:t},[Object(r["h"])("input",{type:"checkbox",checked:n.sources[t],onChange:function(n){return e.$emit("source-toggle",t)}},null,40,["checked","onChange"]),Object(r["g"])(" "+Object(r["C"])(t),1)])})),128))],2)],2)})),D=(n("4de4"),Object(r["K"])("data-v-37304dfd"));Object(r["u"])("data-v-37304dfd");var L={class:"plugins"},U={class:"players"},E={class:"refresh"},F={key:1,class:"no-results"};Object(r["s"])();var W=D((function(e,t,n,a,i,s){var c,l,u,o,d,b,f,p=Object(r["z"])("Chromecast"),m=Object(r["z"])("Kodi"),h=Object(r["z"])("Mplayer"),v=Object(r["z"])("Mpv"),O=Object(r["z"])("Omxplayer"),j=Object(r["z"])("Vlc"),g=Object(r["z"])("Loading"),y=Object(r["z"])("DropdownItem"),w=Object(r["z"])("Dropdown");return Object(r["r"])(),Object(r["e"])(r["a"],null,[Object(r["h"])("div",L,[Object(r["h"])(p,{player:"media.chromecast"===(null===(c=i.selectedPlayer)||void 0===c?void 0:c.pluginName)?i.selectedPlayer:null,ref:"chromecastPlugin",onStatus:t[1]||(t[1]=function(t){return e.$emit("status",t)})},null,8,["player"]),Object(r["h"])(m,{player:"media.kodi"===(null===(l=i.selectedPlayer)||void 0===l?void 0:l.pluginName)?i.selectedPlayer:null,ref:"kodiPlugin",onStatus:t[2]||(t[2]=function(t){return e.$emit("status",t)})},null,8,["player"]),Object(r["h"])(h,{player:"media.mplayer"===(null===(u=i.selectedPlayer)||void 0===u?void 0:u.pluginName)?i.selectedPlayer:null,ref:"mplayerPlugin",onStatus:t[3]||(t[3]=function(t){return e.$emit("status",t)})},null,8,["player"]),Object(r["h"])(v,{player:"media.mpv"===(null===(o=i.selectedPlayer)||void 0===o?void 0:o.pluginName)?i.selectedPlayer:null,ref:"mpvPlugin",onStatus:t[4]||(t[4]=function(t){return e.$emit("status",t)})},null,8,["player"]),Object(r["h"])(O,{player:"media.omxplayer"===(null===(d=i.selectedPlayer)||void 0===d?void 0:d.pluginName)?i.selectedPlayer:null,ref:"omxplayerPlugin",onStatus:t[5]||(t[5]=function(t){return e.$emit("status",t)})},null,8,["player"]),Object(r["h"])(j,{player:"media.vlc"===(null===(b=i.selectedPlayer)||void 0===b?void 0:b.pluginName)?i.selectedPlayer:null,ref:"vlcPlugin",onStatus:t[6]||(t[6]=function(t){return e.$emit("status",t)})},null,8,["player"])]),Object(r["h"])("div",U,[Object(r["h"])(w,{title:(null===(f=i.selectedPlayer)||void 0===f?void 0:f.name)||"Players","icon-class":i.selectedPlayer?i.selectedPlayer.iconClass:"fab fa-chromecast"},{default:D((function(){var e;return[i.loading?(Object(r["r"])(),Object(r["e"])(g,{key:0})):Object(r["f"])("",!0),Object(r["h"])("div",E,[Object(r["h"])(y,{text:"Refresh","icon-class":"fa fa-sync-alt",onClick:s.refresh},null,8,["onClick"])]),(null===(e=i.players)||void 0===e?void 0:e.length)?Object(r["f"])("",!0):(Object(r["r"])(),Object(r["e"])("div",F,"No players found")),(Object(r["r"])(!0),Object(r["e"])(r["a"],null,Object(r["x"])(i.players,(function(e,t){return Object(r["r"])(),Object(r["e"])("div",{class:["player",{selected:null!=i.selectedPlayer&&i.selectedPlayer.pluginName===e.pluginName&&i.selectedPlayer.name===e.name}],key:t},[Object(r["h"])(y,{text:e.name,"icon-class":e.iconClass,onClick:function(t){return s.select(e)}},null,8,["text","icon-class","onClick"])],2)})),128))]})),_:1},8,["title","icon-class"])])],64)})),K=(n("d81d"),n("4fad"),n("8a79"),n("2909")),B=n("ab0f"),A=n("524a");function J(e,t,n,a,i,s){return Object(r["r"])(),Object(r["e"])("div")}var Q=n("5530"),H={name:"Mixin",mixins:[w["a"],x["a"]],emits:["status"],props:{player:{type:Object}},data:function(){return{iconClass:null,name:null,pluginName:null}},methods:{getPlayers:function(){var e=this;return Object(j["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.t0=e.iconClass,t.t1=e.name,t.t2=e.pluginName,t.t3=e,t.next=6,e.status();case 6:return t.t4=t.sent,t.t5={iconClass:t.t0,name:t.t1,pluginName:t.t2,component:t.t3,status:t.t4},t.abrupt("return",[t.t5]);case 9:case"end":return t.stop()}}),t)})))()},status:function(){var e=this;return Object(j["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.request("".concat(e.pluginName,".status"));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))()},play:function(e,t){var n=this;return Object(j["a"])(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(e){r.next=4;break}return r.next=3,n.pause();case 3:return r.abrupt("return",r.sent);case 4:return r.next=6,n.request("".concat(n.pluginName,".play"),{resource:e.url,subtitles:t});case 6:return r.abrupt("return",r.sent);case 7:case"end":return r.stop()}}),r)})))()},pause:function(){var e=this;return Object(j["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.request("".concat(e.pluginName,".pause"));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))()},stop:function(){var e=this;return Object(j["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.request("".concat(e.pluginName,".stop"));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))()},setVolume:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.request("".concat(t.pluginName,".set_volume"),{volume:e});case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n)})))()},seek:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.request("".concat(t.pluginName,".seek"),{position:e});case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n)})))()},onNewMedia:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){var r,a;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.onMediaEvent(e);case 2:r=n.sent,r&&e.title&&t.notify({title:e.player||e.device||(null===(a=t.player)||void 0===a?void 0:a.name)||t.name||t.pluginName,text:e.title,image:{iconClass:t.iconClass||"fa fa-play"}});case 4:case"end":return n.stop()}}),n)})))()},onMediaEvent:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(e.plugin===t.pluginName){n.next=2;break}return n.abrupt("return",!1);case 2:return n.t0=t,n.next=5,t.status();case 5:return n.t1=n.sent,n.t0.$emit.call(n.t0,"status",n.t1),n.abrupt("return",!0);case 8:case"end":return n.stop()}}),n)})))()},addSubtitles:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.request("".concat(t.pluginName,".add_subtitles"),{filename:e});case 2:return n.next=4,t.request("".concat(t.pluginName,".toggle_subtitles"),{visible:!0});case 4:case"end":return n.stop()}}),n)})))()},removeSubtitles:function(){var e=this;return Object(j["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.request("".concat(e.pluginName,".toggle_subtitles"),{visible:!1});case 2:case"end":return t.stop()}}),t)})))()},supports:function(e){return"file"===(null===e||void 0===e?void 0:e.type)||"youtube"===(null===e||void 0===e?void 0:e.type)||(e.url||e).startsWith("file://")||(e.url||e).startsWith("http://")||(e.url||e).startsWith("https://")}},mounted:function(){this.subscribe(this.onNewMedia,"on-new-media-".concat(this.pluginName),"platypush.message.event.media.NewPlayingMediaEvent"),this.subscribe(this.onMediaEvent,"on-media-event-".concat(this.pluginName),"platypush.message.event.media.MediaPlayEvent","platypush.message.event.media.MediaStopEvent","platypush.message.event.media.MediaPauseEvent","platypush.message.event.media.MediaSeekEvent","platypush.message.event.media.MediaVolumeChangedEvent","platypush.message.event.media.MediaMuteChangedEvent")},destroy:function(){this.unsubscribe("on-media-event-".concat(this.pluginName))}},G=H,X={name:"Chromecast",mixins:[G],data:function(){return{name:"Chromecast",pluginName:"media.chromecast",iconClass:"fab fa-chromecast"}},methods:{getPlayers:function(){var e=this;return Object(j["a"])(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.request("".concat(e.pluginName,".get_chromecasts"));case 2:return n=t.sent,t.abrupt("return",Promise.all(n.map(function(){var t=Object(j["a"])(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(Q["a"])(Object(Q["a"])({},n),{},{iconClass:"audio"===n.type?"fa fa-volume-up":"fab fa-chromecast",pluginName:e.pluginName,status:e.request("".concat(e.pluginName,".status"),{chromecast:n.name}),component:e}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())));case 4:case"end":return t.stop()}}),t)})))()},getPlayerName:function(e){var t;return"string"===typeof e?e:e?null===e||void 0===e?void 0:e.name:null===(t=this.player)||void 0===t?void 0:t.name},status:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.request("".concat(t.pluginName,".status"),{chromecast:t.getPlayerName(e)});case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n)})))()},play:function(e,t){var n=this;return Object(j["a"])(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(e){r.next=4;break}return r.next=3,n.pause(t);case 3:return r.abrupt("return",r.sent);case 4:return r.next=6,n.request("".concat(n.pluginName,".play"),{resource:e.url,chromecast:n.getPlayerName(t)});case 6:return r.abrupt("return",r.sent);case 7:case"end":return r.stop()}}),r)})))()},pause:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.request("".concat(t.pluginName,".pause"),{chromecast:t.getPlayerName(e)});case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n)})))()},stop:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.request("".concat(t.pluginName,".quit"),{chromecast:t.getPlayerName(e)});case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n)})))()},setVolume:function(e,t){var n=this;return Object(j["a"])(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,n.request("".concat(n.pluginName,".set_volume"),{volume:e,chromecast:n.getPlayerName(t)});case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r)})))()},seek:function(e,t){var n=this;return Object(j["a"])(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,n.request("".concat(n.pluginName,".seek"),{position:e,chromecast:n.getPlayerName(t)});case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r)})))()},onMediaEvent:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(e.plugin===t.pluginName){n.next=2;break}return n.abrupt("return",!1);case 2:return n.t0=t,n.next=5,t.status(e.player);case 5:return n.t1=n.sent,n.t0.$emit.call(n.t0,"status",n.t1),n.abrupt("return",!0);case 8:case"end":return n.stop()}}),n)})))()},supports:function(e){return"youtube"===(null===e||void 0===e?void 0:e.type)||(e.url||e).startsWith("http://")||(e.url||e).startsWith("https://")}}};X.render=J;var Y=X;function Z(e,t,n,a,i,s){return Object(r["r"])(),Object(r["e"])("div")}var ee={name:"Kodi",mixins:[G],data:function(){return{iconClass:"fa fa-kodi",name:"Kodi",pluginName:"media.kodi"}},methods:{getPlayers:function(){var e=this;return Object(j["a"])(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.t0=e.iconClass,t.t1=e.pluginName,t.t2=(null===(n=e.$root.config["media.kodi"])||void 0===n?void 0:n.host)||e.name,t.t3=e,t.next=6,e.request("".concat(e.pluginName,".status"));case 6:return t.t4=t.sent,t.t5={iconClass:t.t0,pluginName:t.t1,name:t.t2,component:t.t3,status:t.t4},t.abrupt("return",[t.t5]);case 9:case"end":return t.stop()}}),t)})))()},supports:function(e){return"youtube"===(null===e||void 0===e?void 0:e.type)||(e.url||e).startsWith("http://")||(e.url||e).startsWith("https://")}}};ee.render=Z;var te=ee;function ne(e,t,n,a,i,s){return Object(r["r"])(),Object(r["e"])("div")}var re={name:"Mplayer",mixins:[G],data:function(){return{iconClass:"fa fa-tv",name:"MPlayer",pluginName:"media.mplayer"}}};re.render=ne;var ae=re;function ie(e,t,n,a,i,s){return Object(r["r"])(),Object(r["e"])("div")}var se={name:"Mpv",mixins:[G],data:function(){return{iconClass:"fa fa-tv",name:"mpv",pluginName:"media.mpv"}}};se.render=ie;var ce=se;function le(e,t,n,a,i,s){return Object(r["r"])(),Object(r["e"])("div")}var ue={name:"Omxplayer",mixins:[G],data:function(){return{iconClass:"fa fa-tv",name:"OMXPlayer",pluginName:"media.omxplayer"}}};ue.render=le;var oe=ue;function de(e,t,n,a,i,s){return Object(r["r"])(),Object(r["e"])("div")}var be={name:"Vlc",mixins:[G],data:function(){return{iconClass:"fa fa-tv",name:"VLC",pluginName:"media.vlc"}}};be.render=de;var fe=be,pe={name:"Players",components:{Loading:g["a"],DropdownItem:A["a"],Dropdown:B["a"],Chromecast:Y,Kodi:te,Mplayer:ae,Mpv:ce,Omxplayer:oe,Vlc:fe},emits:["select","status"],props:{pluginName:{type:String,required:!0}},data:function(){return{loading:!1,players:[],selectedPlayer:null,config:{},plugins:[]}},methods:{loadPlugins:function(){this.plugins=Object.entries(this.$refs).filter((function(e){return e[0].endsWith("Plugin")})).map((function(e){return e[1]}))},refresh:function(){var e=this;return Object(j["a"])(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.players=[],e.loading=!0,n=e.$root.config,t.prev=3,t.next=6,Promise.all(e.plugins.map(function(){var t=Object(j["a"])(regeneratorRuntime.mark((function t(r){var a,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(r.pluginName in n){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,r.getPlayers();case 4:i=t.sent,(a=e.players).push.apply(a,Object(K["a"])(i)),null==e.selectedPlayer&&r.pluginName===e.pluginName&&i.length>0&&e.select(i[0]);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 6:return t.prev=6,e.loading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[3,,6,9]])})))()},select:function(e){this.selectedPlayer=e,this.$emit("select",e)}},mounted:function(){var e=this;return Object(j["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.loadPlugins();case 2:return t.next=4,e.refresh();case 4:case"end":return t.stop()}}),t)})))()}};n("f334");pe.render=W,pe.__scopeId="data-v-37304dfd";var me=pe,he={name:"Header",components:{Players:me},emits:["search","select-player","player-status","torrent-add","show-subtitles","play-url","filter","source-toggle"],props:{pluginName:{type:String,required:!0},selectedView:{type:String,required:!0},selectedSubtitles:{type:String},selectedItem:{type:Object},hasSubtitlesPlugin:{type:Boolean,default:!1},browserFilter:{type:String,default:""},sources:{type:Object,default:function(){}}},data:function(){return{filterVisible:!1,query:"",torrentURL:""}},methods:{search:function(){var e,t=this,n=Object.keys(this.sources).filter((function(e){return t.sources[e]}));(null===(e=this.query)||void 0===e?void 0:e.length)&&(null===n||void 0===n?void 0:n.length)&&this.$emit("search",{query:this.query,types:n})}},mounted:function(){var e=this;this.$watch((function(){return e.selectedView}),(function(){e.$emit("filter",""),e.torrentURL="",e.query=""}))}};n("edc2");he.render=z,he.__scopeId="data-v-457d4016";var ve=he,Oe=(n("a4d3"),n("e01a"),n("a15b"),Object(r["K"])("data-v-3fc0d8f1"));Object(r["u"])("data-v-3fc0d8f1");var je={key:0,class:"row"},ge=Object(r["h"])("div",{class:"left side"},"Title",-1),ye={class:"right side"},we={key:1,class:"row"},xe=Object(r["h"])("div",{class:"left side"},"Synopsis",-1),ke={key:2,class:"row"},Ce=Object(r["h"])("div",{class:"left side"},"Description",-1),Pe={key:3,class:"row"},Re=Object(r["h"])("div",{class:"left side"},"Summary",-1),Se={key:4,class:"row"},Ne=Object(r["h"])("div",{class:"left side"},"Duration",-1),Me={key:5,class:"row"},Ie=Object(r["h"])("div",{class:"left side"},"Genres",-1),$e={key:6,class:"row"},Ve=Object(r["h"])("div",{class:"left side"},"Channel",-1),qe={class:"right side"},_e={key:7,class:"row"},Te=Object(r["h"])("div",{class:"left side"},"Year",-1),ze={key:8,class:"row"},De=Object(r["h"])("div",{class:"left side"},"Published at",-1),Le={key:9,class:"row"},Ue=Object(r["h"])("div",{class:"left side"},"File",-1),Ee={key:10,class:"row"},Fe=Object(r["h"])("div",{class:"left side"},"URL",-1),We={class:"right side url"},Ke={key:11,class:"row"},Be=Object(r["h"])("div",{class:"left side"},"Trailer",-1),Ae={class:"right side url"},Je={key:12,class:"row"},Qe=Object(r["h"])("div",{class:"left side"},"Size",-1),He={key:13,class:"row"},Ge=Object(r["h"])("div",{class:"left side"},"Quality",-1),Xe={key:14,class:"row"},Ye=Object(r["h"])("div",{class:"left side"},"Seeds",-1),Ze={key:15,class:"row"},et=Object(r["h"])("div",{class:"left side"},"Peers",-1),tt={key:16,class:"row"},nt=Object(r["h"])("div",{class:"left side"},"Language",-1);Object(r["s"])();var rt=Oe((function(e,t,n,a,i,s){var c,l,u,o,d,b,f,p,m,h,v,O,j,g,y,w,x;return Object(r["r"])(),Object(r["e"])(r["a"],null,[(null===(c=n.item)||void 0===c?void 0:c.title)?(Object(r["r"])(),Object(r["e"])("div",je,[ge,Object(r["h"])("div",ye,[n.item.imdb_id?(Object(r["r"])(),Object(r["e"])("a",{key:0,href:"https://www.imdb.com/title/".concat(n.item.imdb_id),target:"_blank",textContent:Object(r["C"])(n.item.title)},null,8,["href","textContent"])):(Object(r["r"])(),Object(r["e"])("span",{key:1,textContent:Object(r["C"])(n.item.title)},null,8,["textContent"]))])])):Object(r["f"])("",!0),(null===(l=n.item)||void 0===l?void 0:l.synopsis)?(Object(r["r"])(),Object(r["e"])("div",we,[xe,Object(r["h"])("div",{class:"right side",textContent:Object(r["C"])(n.item.synopsis)},null,8,["textContent"])])):Object(r["f"])("",!0),(null===(u=n.item)||void 0===u?void 0:u.description)?(Object(r["r"])(),Object(r["e"])("div",ke,[Ce,Object(r["h"])("div",{class:"right side",textContent:Object(r["C"])(n.item.description)},null,8,["textContent"])])):Object(r["f"])("",!0),(null===(o=n.item)||void 0===o?void 0:o.summary)?(Object(r["r"])(),Object(r["e"])("div",Pe,[Re,Object(r["h"])("div",{class:"right side",textContent:Object(r["C"])(n.item.summary)},null,8,["textContent"])])):Object(r["f"])("",!0),(null===(d=n.item)||void 0===d?void 0:d.duration)?(Object(r["r"])(),Object(r["e"])("div",Se,[Ne,Object(r["h"])("div",{class:"right side",textContent:Object(r["C"])(e.convertTime(n.item.duration))},null,8,["textContent"])])):Object(r["f"])("",!0),(null===(b=n.item)||void 0===b?void 0:b.genres)?(Object(r["r"])(),Object(r["e"])("div",Me,[Ie,Object(r["h"])("div",{class:"right side",textContent:Object(r["C"])(n.item.genres.join(", "))},null,8,["textContent"])])):Object(r["f"])("",!0),(null===(f=n.item)||void 0===f?void 0:f.channelId)?(Object(r["r"])(),Object(r["e"])("div",$e,[Ve,Object(r["h"])("div",qe,[Object(r["h"])("a",{href:"https://www.youtube.com/channel/".concat(n.item.channelId),target:"_blank",textContent:Object(r["C"])(n.item.channelTitle||"https://www.youtube.com/channel/".concat(n.item.channelId))},null,8,["href","textContent"])])])):Object(r["f"])("",!0),(null===(p=n.item)||void 0===p?void 0:p.year)?(Object(r["r"])(),Object(r["e"])("div",_e,[Te,Object(r["h"])("div",{class:"right side",textContent:Object(r["C"])(n.item.year)},null,8,["textContent"])])):Object(r["f"])("",!0),(null===(m=n.item)||void 0===m?void 0:m.publishedAt)?(Object(r["r"])(),Object(r["e"])("div",ze,[De,Object(r["h"])("div",{class:"right side",textContent:Object(r["C"])(e.formatDate(n.item.publishedAt,!0))},null,8,["textContent"])])):Object(r["f"])("",!0),(null===(h=n.item)||void 0===h?void 0:h.file)?(Object(r["r"])(),Object(r["e"])("div",Le,[Ue,Object(r["h"])("div",{class:"right side",textContent:Object(r["C"])(n.item.file)},null,8,["textContent"])])):Object(r["f"])("",!0),(null===(v=n.item)||void 0===v?void 0:v.url)?(Object(r["r"])(),Object(r["e"])("div",Ee,[Fe,Object(r["h"])("div",We,[Object(r["h"])("a",{href:n.item.url,target:"_blank",textContent:Object(r["C"])(n.item.url)},null,8,["href","textContent"])])])):Object(r["f"])("",!0),(null===(O=n.item)||void 0===O?void 0:O.trailer)?(Object(r["r"])(),Object(r["e"])("div",Ke,[Be,Object(r["h"])("div",Ae,[Object(r["h"])("a",{href:n.item.trailer,target:"_blank",textContent:Object(r["C"])(n.item.trailer)},null,8,["href","textContent"])])])):Object(r["f"])("",!0),(null===(j=n.item)||void 0===j?void 0:j.size)?(Object(r["r"])(),Object(r["e"])("div",Je,[Qe,Object(r["h"])("div",{class:"right side",textContent:Object(r["C"])(e.convertSize(n.item.size))},null,8,["textContent"])])):Object(r["f"])("",!0),(null===(g=n.item)||void 0===g?void 0:g.quality)?(Object(r["r"])(),Object(r["e"])("div",He,[Ge,Object(r["h"])("div",{class:"right side",textContent:Object(r["C"])(n.item.quality)},null,8,["textContent"])])):Object(r["f"])("",!0),(null===(y=n.item)||void 0===y?void 0:y.seeds)?(Object(r["r"])(),Object(r["e"])("div",Xe,[Ye,Object(r["h"])("div",{class:"right side",textContent:Object(r["C"])(n.item.seeds)},null,8,["textContent"])])):Object(r["f"])("",!0),(null===(w=n.item)||void 0===w?void 0:w.peers)?(Object(r["r"])(),Object(r["e"])("div",Ze,[et,Object(r["h"])("div",{class:"right side",textContent:Object(r["C"])(n.item.peers)},null,8,["textContent"])])):Object(r["f"])("",!0),(null===(x=n.item)||void 0===x?void 0:x.language)?(Object(r["r"])(),Object(r["e"])("div",tt,[nt,Object(r["h"])("div",{class:"right side",textContent:Object(r["C"])(n.item.language)},null,8,["textContent"])])):Object(r["f"])("",!0)],64)})),at={name:"Info",mixins:[w["a"],x["a"]],props:{item:{type:Object,default:function(){}}}};n("45d7");at.render=rt,at.__scopeId="data-v-3fc0d8f1";var it=at,st=Object(r["K"])("data-v-4597e14d"),ct=st((function(e,t,n,a,i,s){return Object(r["r"])(),Object(r["e"])("nav",null,[(Object(r["r"])(!0),Object(r["e"])(r["a"],null,Object(r["x"])(n.views,(function(t,a){return Object(r["r"])(),Object(r["e"])("li",{key:a,title:t.displayName,class:{selected:a===n.selectedView},onClick:function(t){return e.$emit("input",a)}},[Object(r["h"])("i",{class:t.iconClass},null,2)],10,["title","onClick"])})),128))])})),lt={name:"Nav",emits:["input"],props:{selectedView:{type:String},collapsed:{type:Boolean,default:!1},views:{type:Object,default:function(){return{search:{iconClass:"fa fa-search",displayName:"Search"},browser:{iconClass:"fa fa-folder",displayName:"Browser"},torrents:{iconClass:"fa fa-magnet",displayName:"Torrents"}}}}}};n("7d0e");lt.render=ct,lt.__scopeId="data-v-4597e14d";var ut=lt,ot=Object(r["K"])("data-v-acfde602");Object(r["u"])("data-v-acfde602");var dt={class:"media-results"},bt={key:0,class:"no-content"},ft={class:"col-10 left side"},pt={class:"icon"},mt={class:"col-2 right side"};Object(r["s"])();var ht=ot((function(e,t,n,a,i,s){var c,l=Object(r["z"])("DropdownItem"),u=Object(r["z"])("Dropdown");return Object(r["r"])(),Object(r["e"])("div",dt,[(null===(c=n.results)||void 0===c?void 0:c.length)?Object(r["f"])("",!0):(Object(r["r"])(),Object(r["e"])("div",bt," No search results ")),(Object(r["r"])(!0),Object(r["e"])(r["a"],null,Object(r["x"])(n.results,(function(t,a){return Object(r["r"])(),Object(r["e"])("div",{class:["row item",{selected:n.selectedResult===a,hidden:!n.sources[t.type]}],key:a,onClick:function(t){return e.$emit("select",a)}},[Object(r["h"])("div",ft,[Object(r["h"])("div",pt,[Object(r["h"])("i",{class:i.typeIcons[t.type]},null,2)]),Object(r["h"])("div",{class:"title",textContent:Object(r["C"])(t.title)},null,8,["textContent"])]),Object(r["h"])("div",mt,[Object(r["h"])(u,{title:"Actions","icon-class":"fa fa-ellipsis-h",onClick:function(t){return e.$emit("select",a)}},{default:ot((function(){return["torrent"!==(null===t||void 0===t?void 0:t.type)?(Object(r["r"])(),Object(r["e"])(l,{key:0,"icon-class":"fa fa-play",text:"Play",onClick:function(n){return e.$emit("play",t)}},null,8,["onClick"])):Object(r["f"])("",!0),"torrent"===(null===t||void 0===t?void 0:t.type)?(Object(r["r"])(),Object(r["e"])(l,{key:1,"icon-class":"fa fa-download",text:"Download",onClick:function(n){return e.$emit("download",t)}},null,8,["onClick"])):Object(r["f"])("",!0),"file"===(null===t||void 0===t?void 0:t.type)?(Object(r["r"])(),Object(r["e"])(l,{key:2,"icon-class":"fa fa-window-maximize",text:"View in browser",onClick:function(n){return e.$emit("view",t)}},null,8,["onClick"])):Object(r["f"])("",!0),Object(r["h"])(l,{"icon-class":"fa fa-info",text:"Info",onClick:function(n){return e.$emit("info",t)}},null,8,["onClick"])]})),_:2},1032,["onClick"])])],10,["onClick"])})),128))])})),vt=(n("a9e3"),{name:"Results",components:{Dropdown:B["a"],DropdownItem:A["a"]},emits:["select","info","play","view","download"],props:{results:{type:Array,default:function(){return[]}},selectedResult:{type:Number},sources:{type:Object,default:function(){}}},data:function(){return{typeIcons:{file:"fa fa-hdd",torrent:"fa fa-magnet",youtube:"fab fa-youtube",plex:"fa fa-plex"}}}});n("e0af");vt.render=ht,vt.__scopeId="data-v-acfde602";var Ot=vt,jt=Object(r["K"])("data-v-77ae3705");Object(r["u"])("data-v-77ae3705");var gt={class:"subtitles-container"},yt={class:"items"},wt=Object(r["h"])("div",{class:"col-1 icon"},[Object(r["h"])("i",{class:"fa fa-ban"})],-1),xt=Object(r["h"])("div",{class:"col-11 title"},"None",-1),kt={class:"col-1 icon"},Ct={key:0,class:"fa fa-file"},Pt={key:2,class:"fa fa-closed-captioning"},Rt={class:"footer"};Object(r["s"])();var St=jt((function(e,t,n,a,i,s){var c=Object(r["z"])("Loading");return Object(r["r"])(),Object(r["e"])("div",gt,[Object(r["h"])("div",yt,[i.loading?(Object(r["r"])(),Object(r["e"])(c,{key:0})):Object(r["f"])("",!0),Object(r["h"])("div",{class:["row item",{selected:null==i.selectedItem}],onClick:t[1]||(t[1]=function(e){return i.selectedItem=null})},[wt,xt],2),(Object(r["r"])(!0),Object(r["e"])(r["a"],null,Object(r["x"])(i.items,(function(e,t){return Object(r["r"])(),Object(r["e"])("div",{class:["row item",{selected:i.selectedItem===t}],key:t,onClick:function(e){return i.selectedItem=t}},[Object(r["h"])("div",kt,[e.IsLocal?(Object(r["r"])(),Object(r["e"])("i",Ct)):e.ISO639?(Object(r["r"])(),Object(r["e"])("i",{key:1,class:["flag-icon","flag-icon-".concat(e.ISO639)]},null,2)):(Object(r["r"])(),Object(r["e"])("i",Pt))]),Object(r["g"])(" "+Object(r["C"])(e.SubFileName),1)],10,["onClick"])})),128))]),Object(r["h"])("div",Rt,[Object(r["h"])("button",{onClick:t[2]||(t[2]=function(t){return e.$emit("select-subs",null==i.selectedItem?null:i.items[i.selectedItem])})},"Select")])])})),Nt={name:"Subtitles",mixins:[w["a"]],components:{Loading:g["a"]},emits:["select-subs"],props:{item:{type:Object,default:function(){}}},data:function(){return{loading:!1,items:[],selectedItem:null}},methods:{refresh:function(){var e=this;return Object(j["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.prev=1,t.next=4,e.request("media.subtitles.search",{resource:e.item.url,language:"all"});case 4:e.items=t.sent;case 5:return t.prev=5,e.loading=!1,t.finish(5);case 8:case"end":return t.stop()}}),t,null,[[1,,5,8]])})))()}},mounted:function(){this.refresh()}};n("00a9");Nt.render=St,Nt.__scopeId="data-v-77ae3705";var Mt=Nt,It=n("0cc1"),$t=(n("1276"),Object(r["K"])("data-v-a2e5c946"));Object(r["u"])("data-v-a2e5c946");var Vt={class:"browser-container"},qt=Object(r["h"])("div",{class:"col-10 left side"},[Object(r["h"])("i",{class:"icon fa fa-folder"}),Object(r["h"])("span",{class:"name"},"..")],-1),_t={class:"col-10"},Tt={class:"name"},zt={class:"col-2 actions"};Object(r["s"])();var Dt=$t((function(e,t,n,a,i,s){var c,l=Object(r["z"])("Loading"),u=Object(r["z"])("DropdownItem"),o=Object(r["z"])("Dropdown");return Object(r["r"])(),Object(r["e"])("div",Vt,[i.loading?(Object(r["r"])(),Object(r["e"])(l,{key:0})):Object(r["f"])("",!0),(null===(c=i.path)||void 0===c?void 0:c.length)&&"/"!==i.path?(Object(r["r"])(),Object(r["e"])("div",{key:1,class:"row item",onClick:t[1]||(t[1]=function(e){return i.path=(i.path||"")+"/.."})},[qt])):Object(r["f"])("",!0),(Object(r["r"])(!0),Object(r["e"])(r["a"],null,Object(r["x"])(s.filteredFiles,(function(t,a){return Object(r["r"])(),Object(r["e"])("div",{class:"row item",key:a,onClick:function(e){return i.path=t.path}},[Object(r["h"])("div",_t,[Object(r["h"])("i",{class:["icon fa",{"fa-file":"directory"!==t.type,"fa-folder":"directory"===t.type}]},null,2),Object(r["h"])("span",Tt,Object(r["C"])(t.name),1)]),Object(r["h"])("div",zt,[Object(r["h"])(o,null,{default:$t((function(){return[n.isMedia&&e.mediaExtensions.has(t.name.split(".").pop())?(Object(r["r"])(),Object(r["e"])(u,{key:0,"icon-class":"fa fa-play",text:"Play",onClick:function(n){return e.$emit("play",{type:"file",url:"file://".concat(t.path)})}},null,8,["onClick"])):Object(r["f"])("",!0)]})),_:2},1024)])],8,["onClick"])})),128))])})),Lt=(n("c975"),{name:"Browser",components:{DropdownItem:A["a"],Dropdown:B["a"],Loading:g["a"]},mixins:[w["a"],x["a"]],emits:["path-change"],props:{initialPath:{type:String},isMedia:{type:Boolean},filter:{type:String,default:""}},data:function(){return{loading:!1,path:this.initialPath,files:[]}},computed:{filteredFiles:function(){var e,t=this;return(null===(e=this.filter)||void 0===e?void 0:e.length)?this.files.filter((function(e){return((null===e||void 0===e?void 0:e.name)||"").toLowerCase().indexOf(t.filter.toLowerCase())>=0})):this.files}},methods:{refresh:function(){var e=this;return Object(j["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.prev=1,t.next=4,e.request("file.list",{path:e.path});case 4:e.files=t.sent,e.$emit("path-change",e.path);case 6:return t.prev=6,e.loading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()}},mounted:function(){var e=this;this.$watch((function(){return e.path}),(function(){return e.refresh()})),this.refresh()}});n("0bc6");Lt.render=Dt,Lt.__scopeId="data-v-a2e5c946";var Ut=Lt,Et={name:"Media",mixins:[w["a"],x["a"]],components:{Browser:Ut,Loading:g["a"],MediaView:k["a"],Header:ve,Results:Ot,Modal:y["a"],Info:it,Nav:ut,TorrentView:It["a"],Subtitles:Mt},props:{pluginName:{type:String,required:!0},mediaButtons:{type:Object,default:function(){return{previous:!1,next:!1,stop:!0}}}},data:function(){return{loading:!1,results:[],selectedResult:null,selectedPlayer:null,selectedView:"search",selectedSubtitles:null,showSubtitlesModal:!1,awaitingPlayTorrent:null,urlPlay:null,browserFilter:null,torrentPlugin:null,torrentPlugins:["torrent","rtorrent"],sources:{file:!0,youtube:!0,torrent:!0}}},computed:{hasSubtitlesPlugin:function(){return"media.subtitles"in this.$root.config}},methods:{search:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return t.loading=!0,n.prev=1,n.next=4,t.request("".concat(t.pluginName,".search"),e);case 4:t.results=n.sent;case 5:return n.prev=5,t.loading=!1,n.finish(5);case 8:case"end":return n.stop()}}),n,null,[[1,,5,8]])})))()},play:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if("torrent"!==(null===(r=e)||void 0===r?void 0:r.type)){n.next=5;break}return t.awaitingPlayTorrent=e.url,n.next=4,t.download(e);case 4:return n.abrupt("return");case 5:if(t.selectedPlayer.component.supports(e)){n.next=9;break}return n.next=8,t.startStreaming(e);case 8:e=n.sent;case 9:return n.next=11,t.selectedPlayer.component.play(e,t.selectedSubtitles,t.selectedPlayer);case 11:return n.next=13,t.refresh();case 13:case"end":return n.stop()}}),n)})))()},pause:function(){var e=this;return Object(j["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.selectedPlayer.component.pause(e.selectedPlayer);case 2:return t.next=4,e.refresh();case 4:case"end":return t.stop()}}),t)})))()},stop:function(){var e=this;return Object(j["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.selectedPlayer.component.stop(e.selectedPlayer);case 2:return t.next=4,e.refresh();case 4:case"end":return t.stop()}}),t)})))()},setVolume:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.selectedPlayer.component.setVolume(e,t.selectedPlayer);case 2:return n.next=4,t.refresh();case 4:case"end":return n.stop()}}),n)})))()},seek:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.selectedPlayer.component.seek(e,t.selectedPlayer);case 2:return n.next=4,t.refresh();case 4:case"end":return n.stop()}}),n)})))()},view:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.startStreaming(e,!0);case 2:r=n.sent,window.open(r.url,"_blank");case 4:case"end":return n.stop()}}),n)})))()},download:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if("torrent"!==(null===e||void 0===e?void 0:e.type)){n.next=3;break}return n.next=3,t.downloadTorrent(e);case 3:case"end":return n.stop()}}),n)})))()},refresh:function(){var e=this;return Object(j["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.selectedPlayer.component.status(e.selectedPlayer);case 2:e.selectedPlayer.status=t.sent;case 3:case"end":return t.stop()}}),t)})))()},onStatusUpdate:function(e){this.selectedPlayer&&(this.selectedPlayer.status=e)},onTorrentQueued:function(e){this.notify({title:"Torrent queued for download",text:e.name,image:{iconClass:"fa fa-magnet"}})},onTorrentMetadata:function(e){this.notify({title:"Torrent metadata downloaded",text:e.name,image:{iconClass:"fa fa-info"}})},onTorrentDownloadStart:function(e){this.notify({title:"Torrent download started",text:e.name,image:{iconClass:"fa fa-download"}})},onTorrentDownloadCompleted:function(e){this.notify({title:"Torrent download completed",text:e.name,image:{iconClass:"fa fa-check"}})},getTorrentPlugin:function(){var e=this.$root.config[this.pluginName]||{},t=e.torrent_plugin;if(!t){var n,r=Object(O["a"])(this.torrentPlugins);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(a in this.$root.config){t=a;break}}}catch(i){r.e(i)}finally{r.f()}}return t},downloadTorrent:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=t.getTorrentPlugin(),r){n.next=4;break}return t.notify({text:"No torrent plugins configured",error:!0}),n.abrupt("return");case 4:return n.next=6,t.request("".concat(r,".download"),{torrent:(null===e||void 0===e?void 0:e.url)||e});case 6:return n.abrupt("return",n.sent);case 7:case"end":return n.stop()}}),n)})))()},selectSubtitles:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t.$refs.subtitlesSelector.close(),e){n.next=4;break}return t.selectedSubtitles=null,n.abrupt("return");case 4:return t.notify({text:"Downloading subtitles track",image:{iconClass:"fa fa-download"}}),n.next=7,t.request("media.subtitles.download",{link:e.SubDownloadLink});case 7:r=n.sent,t.selectedSubtitles=r.filename,t.notify({text:"Subtitles track downloaded",image:{iconClass:"fa fa-check"}});case 10:case"end":return n.stop()}}),n)})))()},onResultSelect:function(e){null!=this.selectedResult&&this.selectedResult===e||(this.selectedResult=e,this.selectedSubtitles=null)},playUrl:function(e){var t=this;return Object(j["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return t.loading=!0,n.prev=1,n.next=4,t.play({url:e});case 4:t.$refs.playUrlModal.close();case 5:return n.prev=5,t.loading=!1,n.finish(5);case 8:case"end":return n.stop()}}),n,null,[[1,,5,8]])})))()}},mounted:function(){var e=this;this.$watch((function(){return e.selectedPlayer}),(function(t){t&&e.refresh()})),this.$watch((function(){return e.selectedSubtitles}),(function(t){var n,r;new Set(["play","pause"]).has(null===(n=e.selectedPlayer)||void 0===n||null===(r=n.status)||void 0===r?void 0:r.state)&&(t?e.selectedPlayer.component.addSubtitles(t):e.selectedPlayer.component.removeSubtitles())})),this.torrentPlugin=this.getTorrentPlugin(),this.subscribe(this.onTorrentQueued,"notify-on-torrent-queued","platypush.message.event.torrent.TorrentQueuedEvent"),this.subscribe(this.onTorrentMetadata,"on-torrent-metadata","platypush.message.event.torrent.TorrentDownloadedMetadataEvent"),this.subscribe(this.onTorrentDownloadStart,"notify-on-torrent-download-start","platypush.message.event.torrent.TorrentDownloadStartEvent"),this.subscribe(this.onTorrentDownloadCompleted,"notify-on-torrent-download-completed","platypush.message.event.torrent.TorrentDownloadCompletedEvent"),"media.plex"in this.$root.config&&(this.sources.plex=!0)},destroy:function(){this.unsubscribe("notify-on-torrent-queued"),this.unsubscribe("on-torrent-metadata"),this.unsubscribe("notify-on-torrent-download-start"),this.unsubscribe("notify-on-torrent-download-completed")}};n("e483");Et.render=v,Et.__scopeId="data-v-3055ba65";t["default"]=Et},"45d7":function(e,t,n){"use strict";n("2b05")},"51eb":function(e,t,n){},"5a34":function(e,t,n){var r=n("44e7");e.exports=function(e){if(r(e))throw TypeError("The method doesn't accept regular expressions");return e}},"776b":function(e,t,n){},"7d0e":function(e,t,n){"use strict";n("d428")},"8a79":function(e,t,n){"use strict";var r=n("23e7"),a=n("06cf").f,i=n("50c4"),s=n("5a34"),c=n("1d80"),l=n("ab13"),u=n("c430"),o="".endsWith,d=Math.min,b=l("endsWith"),f=!u&&!b&&!!function(){var e=a(String.prototype,"endsWith");return e&&!e.writable}();r({target:"String",proto:!0,forced:!f&&!b},{endsWith:function(e){var t=String(c(this));s(e);var n=arguments.length>1?arguments[1]:void 0,r=i(t.length),a=void 0===n?r:d(i(n),r),l=String(e);return o?o.call(t,l,a):t.slice(a-l.length,a)===l}})},9894:function(e,t,n){},ab13:function(e,t,n){var r=n("b622"),a=r("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[a]=!1,"/./"[e](t)}catch(r){}}return!1}},ce5d:function(e,t,n){},d428:function(e,t,n){},e0af:function(e,t,n){"use strict";n("3627")},e483:function(e,t,n){"use strict";n("ce5d")},edc2:function(e,t,n){"use strict";n("51eb")},eede:function(e,t,n){"use strict";n.r(t);var r=n("7a23"),a=Object(r["K"])("data-v-7264d7fc"),i=a((function(e,t,n,a,i,s){var c=Object(r["z"])("Media");return Object(r["r"])(),Object(r["e"])(c,{"plugin-name":"media.omxplayer"})})),s=n("3951"),c={name:"MediaMpv",components:{Media:s["default"]}};c.render=i,c.__scopeId="data-v-7264d7fc";t["default"]=c},f279:function(e,t,n){},f334:function(e,t,n){"use strict";n("776b")}}]);
|
|
//# sourceMappingURL=chunk-abbc1cdc.47491a05.js.map
|