EmbyCrackedClient/web/modules/backdropscreensaver/plugin.js
2025-06-25 11:46:04 +08:00

1 line
No EOL
1.1 KiB
JavaScript

import connectionManager from"./../emby-apiclient/connectionmanager.js";function BackdropScreenSaver(){this.name="Backdrop Screen Saver",this.type="screensaver",this.id="backdropscreensaver",this.supportsAnonymous=!1}function getItems(query){query=Object.assign({ImageTypes:"Backdrop",EnableImageTypes:"Backdrop",IncludeItemTypes:"Movie,Series,MusicArtist,Game",SortBy:"Random",Recursive:!0,ImageTypeLimit:1,Fields:"ProductionYear"},query);var apiClient=connectionManager.currentApiClient();return apiClient.getItems(apiClient.getCurrentUserId(),query)}BackdropScreenSaver.prototype.show=function(){if(!this.currentSlideshow){let instance=this;Emby.importModule("./modules/slideshow/slideshow.js").then(function(slideshow){instance.currentSlideshow||((slideshow=new slideshow({showTitle:!0,cover:!0,getItems:getItems,cardFields:["Name","ProductionYear"],interactive:!1,autoplay:!0})).show(),instance.currentSlideshow=slideshow)})}},BackdropScreenSaver.prototype.hide=function(){var currentSlideshow=this.currentSlideshow;currentSlideshow&&(currentSlideshow.hide(),this.currentSlideshow=null)};export default BackdropScreenSaver;