This commit is contained in:
root
2023-08-31 15:30:17 +02:00
commit dea16b40a8
833 changed files with 142024 additions and 0 deletions

View File

@@ -0,0 +1 @@
define(["exports","./../servicelocator.js","./../usersettings/usersettings.js"],function(_exports,_servicelocator,_usersettings){function getResolvedPromise(){return Promise.resolve()}function showMessage(text,userSettingsKey,appHostFeature){var dayNum,options;return _servicelocator.appHost.supports(appHostFeature)||(userSettingsKey+=(appHostFeature=new Date).getFullYear()+"-w"+(appHostFeature=appHostFeature,dayNum=(appHostFeature=new Date(Date.UTC(appHostFeature.getFullYear(),appHostFeature.getMonth(),appHostFeature.getDate()))).getUTCDay()||7,appHostFeature.setUTCDate(appHostFeature.getUTCDate()+4-dayNum),dayNum=new Date(Date.UTC(appHostFeature.getUTCFullYear(),0,1)),Math.ceil(((appHostFeature-dayNum)/864e5+1)/7)),"1"===_usersettings.default.get(userSettingsKey,!1))?Promise.resolve():(_usersettings.default.set(userSettingsKey,"1",!1),options=text,Emby.importModule("./modules/common/dialogs/alert.js").then(function(alert){return alert(options)}).catch(getResolvedPromise))}function ExpirementalPlaybackWarnings(){this.name="Experimental playback warnings",this.type="preplayintercept",this.id="expirementalplaybackwarnings"}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,ExpirementalPlaybackWarnings.prototype.intercept=function(options){options=options.item;return options?"iso"===options.Container||"blurayiso"===options.Container||"dvdiso"===options.Container?showMessage("Playback of ISO files in this app is experimental. Some titles may not work at all. For a better experience, consider converting to mkv video files, or use an Emby app with native ISO support.","isoexpirementalinfo","nativeisoplayback"):"bluray"===options.Container?showMessage("Playback of Bluray folders in this app is experimental. Some titles may not work at all. For a better experience, consider converting to mkv video files, or use an Emby app with native Bluray folder support.","blurayexpirementalinfo","nativeblurayplayback"):"dvd"===options.Container?showMessage("Playback of Dvd folders in this app is experimental. Some titles may not work at all. For a better experience, consider converting to mkv video files, or use an Emby app with native Dvd folder support.","dvdexpirementalinfo","nativedvdplayback"):Promise.resolve():Promise.resolve()},_exports.default=ExpirementalPlaybackWarnings});

View File

@@ -0,0 +1 @@
define(["exports","./../globalize.js","./../../emby-apiclient/connectionmanager.js"],function(_exports,_globalize,_connectionmanager){function showErrorMessage(){return options=_globalize.default.translate("MessagePlayAccessRestricted"),Emby.importModule("./modules/common/dialogs/alert.js").then(function(alert){return alert(options)}).then(function(){return Promise.reject()});var options}function PlayAccessValidation(){this.name="Playback validation",this.type="preplayintercept",this.id="playaccessvalidation",this.order=-2}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,PlayAccessValidation.prototype.intercept=function(options){var item=options.item;return(item=item&&item.ServerId)?_connectionmanager.default.getApiClient(item).getCurrentUser().then(function(user){return user.Policy.EnableMediaPlayback?Promise.resolve():options.fullscreen?showErrorMessage():Promise.reject()}):Promise.resolve()},_exports.default=PlayAccessValidation});

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
define(["exports","./playbackmanager.js","./../../emby-apiclient/apiclient.js"],function(_exports,_playbackmanager,_apiclient){function validatePlayback(options){var feature="playback";if("playback"===(feature=!options.item||"TvChannel"!==options.item.Type&&"Recording"!==options.item.Type?feature:"livetv")){var player=_playbackmanager.default.getCurrentPlayer();if(player&&!player.isLocalPlayer)return Promise.resolve()}return new Promise(function(resolve,reject){require(["registrationServices"],function(registrationServices){registrationServices.validateFeature(feature,options).then(function(result){result&&result.enableTimeLimit&&(stopAutoStopTimer(),autoStopTimeout=setTimeout(onAutoStopTimeout,63e3)),resolve()},reject)})})}var autoStopTimeout;function onAutoStopTimeout(){stopAutoStopTimer(),_playbackmanager.default.stop()}function stopAutoStopTimer(){autoStopTimeout&&(clearTimeout(autoStopTimeout),autoStopTimeout=null)}function PlaybackValidation(){this.name="Playback validation",this.type="preplayintercept",this.id="playbackvalidation",this.order=-1}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,PlaybackValidation.prototype.intercept=function(options){return!options.fullscreen||options.item&&_apiclient.default.isLocalItem(options.item)?Promise.resolve():validatePlayback(options)},_exports.default=PlaybackValidation});

View File

@@ -0,0 +1 @@
define(["exports","./../globalize.js","./../../dialog/dialog.js","./playbackmanager.js"],function(_exports,_globalize,_dialog,_playbackmanager){function PlayQueueConfirmation(){this.name="Play Queue Confirmation",this.type="preplayintercept",this.id="playqueueconfirmation"}function showConfirmation(playOptions){var player=_playbackmanager.default.getCurrentPlayer(),options={text:_globalize.default.translate("AfterThisPlaysConfirmation")},items=[];return items.push({name:_globalize.default.translate("Keep"),id:"keep",type:"submit"}),items.push({name:_globalize.default.translate("Clear"),id:"clear"}),items.push({name:_globalize.default.translate("Cancel"),id:"cancel",type:"cancel"}),options.buttons=items,(0,_dialog.default)(options).then(function(result){return"cancel"===result?Promise.reject():"keep"===result?function(options,player){var currentPlaylistIndex=_playbackmanager.default.getCurrentPlaylistIndex(player);return-1===currentPlaylistIndex?Promise.resolve():_playbackmanager.default.getPlaylist({StartIndex:currentPlaylistIndex},player).then(function(result){var items=options.items,result=result.Items;if(!result.length)return Promise.resolve();items.push.apply(items,babelHelpers.toConsumableArray(result))})}(playOptions,player):Promise.resolve()})}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,PlayQueueConfirmation.prototype.intercept=function(options){var item=options.item;if(item&&"play"===options.command&&"Audio"===options.mediaType&&_playbackmanager.default.isPlayingAudio()&&options.fullscreen){item=_playbackmanager.default.getCurrentPlaylistLength();if(1<item)return showConfirmation(options)}return Promise.resolve()},_exports.default=PlayQueueConfirmation});

View File

@@ -0,0 +1 @@
define(["exports"],function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0;var currentId=0;function addUniquePlaylistItemId(item){item.PlaylistItemId||(item.PlaylistItemId="playlistItem"+currentId,currentId++)}function PlayQueueManager(){this._playlist=[],this._repeatMode="RepeatNone"}PlayQueueManager.prototype.getPlaylistResult=function(options){options&&(startIndex=options.StartIndex,limit=options.Limit);var startIndex,limit,options=this._playlist,total=options.length,options=options.slice(startIndex||0);return limit&&options.length>limit&&(options.length=limit),{Items:options,TotalRecordCount:total}},PlayQueueManager.prototype.getPlaylist=function(){return this._playlist.slice(0)},PlayQueueManager.prototype.setPlaylist=function(items){for(var i=0,length=(items=items.slice(0)).length;i<length;i++)addUniquePlaylistItemId(items[i]);this._currentPlaylistItemId=null,this._currentPlaylistIndex=-1,this._playlist=items,this._repeatMode="RepeatNone"},PlayQueueManager.prototype.queue=function(items){for(var i=0,length=items.length;i<length;i++)addUniquePlaylistItemId(items[i]),this._playlist.push(items[i])},PlayQueueManager.prototype.queueNext=function(items){for(var i=0,length=items.length;i<length;i++)addUniquePlaylistItemId(items[i]);var destArray,arrayToInsert,args,currentIndex=this.getCurrentPlaylistIndex();-1===currentIndex?currentIndex=this._playlist.length:currentIndex++,destArray=this._playlist,currentIndex=currentIndex,arrayToInsert=items,(args=[]).push(currentIndex),args.push(0),args=args.concat(arrayToInsert),destArray.splice.apply(destArray,args)},PlayQueueManager.prototype.getCurrentPlaylistLength=function(){return this._playlist.length},PlayQueueManager.prototype.getCurrentPlaylistIndex=function(){return this._currentPlaylistIndex},PlayQueueManager.prototype.getCurrentItem=function(){var index=this._currentPlaylistIndex;return-1===index?null:this._playlist[index]},PlayQueueManager.prototype.getCurrentPlaylistItemId=function(){return this._currentPlaylistItemId},PlayQueueManager.prototype.setPlaylistState=function(playlistItemId,playlistIndex){this._currentPlaylistItemId=playlistItemId,null==playlistIndex?this.refreshPlaylistIndex(playlistItemId):this._currentPlaylistIndex=playlistIndex},PlayQueueManager.prototype.refreshPlaylistIndex=function(playlistItemId){this._currentPlaylistIndex=function(playlistItemId,list){for(var i=0,length=list.length;i<length;i++)if(list[i].PlaylistItemId===playlistItemId)return i;return-1}(playlistItemId||this._currentPlaylistItemId,this._playlist)},PlayQueueManager.prototype.setPlaylistIndex=function(playlistIndex){playlistIndex<0?this.setPlaylistState(null):this.setPlaylistState(this._playlist[playlistIndex].PlaylistItemId)},PlayQueueManager.prototype.removeFromPlaylist=function(playlistItemIds){var currentPlaylistItemId,playlist=this.getPlaylist();return playlist.length<=playlistItemIds.length?{result:"empty"}:(currentPlaylistItemId=this.getCurrentPlaylistItemId(),currentPlaylistItemId=-1!==playlistItemIds.indexOf(currentPlaylistItemId),this._playlist=playlist.filter(function(item){return!playlistItemIds.includes(item.PlaylistItemId)}),this.refreshPlaylistIndex(),{result:"removed",isCurrentIndex:currentPlaylistItemId})},PlayQueueManager.prototype.movePlaylistItem=function(playlistItemId,newIndex){for(var oldIndex,from,playlist=this.getPlaylist(),i=0,length=playlist.length;i<length;i++)if(playlist[i].PlaylistItemId===playlistItemId){oldIndex=i;break}if(-1===oldIndex||oldIndex===newIndex)return{result:"noop"};if(newIndex>=playlist.length)throw new Error("newIndex out of bounds");return from=oldIndex,playlist.splice(newIndex,0,playlist.splice(from,1)[0]),this._playlist=playlist,this.refreshPlaylistIndex(),{result:"moved",playlistItemId:playlistItemId,oldIndex:oldIndex,newIndex:newIndex}},PlayQueueManager.prototype.reset=function(){this._playlist=[],this._currentPlaylistItemId=null,this._currentPlaylistIndex=-1,this._repeatMode="RepeatNone"},PlayQueueManager.prototype.setRepeatMode=function(value){this._repeatMode=value},PlayQueueManager.prototype.getRepeatMode=function(){return this._repeatMode},PlayQueueManager.prototype.getNextItemInfo=function(){var newIndex,playlist=this.getPlaylist(),playlistLength=playlist.length;switch(this.getRepeatMode()){case"RepeatOne":newIndex=this.getCurrentPlaylistIndex();break;case"RepeatAll":playlistLength<=(newIndex=this.getCurrentPlaylistIndex()+1)&&(newIndex=0);break;default:newIndex=this.getCurrentPlaylistIndex()+1}return!(newIndex<0||playlistLength<=newIndex)&&(playlist=playlist[newIndex])?{item:playlist,index:newIndex}:null},_exports.default=PlayQueueManager});