Music Libraries UI
This commit is contained in:
parent
5650d07a54
commit
9982f3c3db
@ -525,6 +525,11 @@ module.exports = function ($timeout, $location, dizquetv, resolutionOptions) {
|
||||
if ( angle >= 350 || angle < 10 ) {
|
||||
angle += 53;
|
||||
}
|
||||
} else if (program.type === 'track') {
|
||||
r = 10, g = 10, b = 10;
|
||||
r2 = 245, g2 = 245, b2 = 245;
|
||||
angle = 315;
|
||||
w = 2;
|
||||
} else {
|
||||
r = 10, g = 10, b = 10;
|
||||
r2 = 245, g2 = 245, b2 = 245;
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
<span class="fa {{ a.collapse ? 'fa-chevron-down' : 'fa-chevron-right' }} tab"></span>
|
||||
<img ng-if="displayImages" lazy-img="{{a.icon}}" />
|
||||
<span>{{a.title}}</span><!-- Library -->
|
||||
<span ng-if="a.type === 'show' || a.type === 'movie'" class="flex-pull-right" ng-click='$event.stopPropagation(); selectLibrary(a)'>
|
||||
<span ng-if="a.type === 'show' || a.type === 'movie' || a.type === 'artist'" class="flex-pull-right" ng-click='$event.stopPropagation(); selectLibrary(a)'>
|
||||
<span class="fa fa-plus btn"></span>
|
||||
</span>
|
||||
</div>
|
||||
@ -57,7 +57,7 @@
|
||||
<span ng-if="b.type === 'playlist'" class="flex-pull-right" ng-click="$event.stopPropagation(); selectPlaylist(b);">
|
||||
<span class="fa fa-plus btn"></span>
|
||||
</span>
|
||||
<span ng-if="b.type === 'show' || b.type === 'collection' || b.type === 'genre'" class="flex-pull-right" ng-click="$event.stopPropagation(); selectShow(b);">
|
||||
<span ng-if="b.type === 'show' || b.type === 'collection' || b.type === 'genre' || b.type === 'artist'" class="flex-pull-right" ng-click="$event.stopPropagation(); selectShow(b);">
|
||||
<span class="fa fa-plus btn"></span>
|
||||
</span>
|
||||
</div>
|
||||
@ -81,7 +81,7 @@
|
||||
class="flex-pull-right">
|
||||
{{c.durationStr}}
|
||||
</span>
|
||||
<span ng-if="c.type === 'season'" class="flex-pull-right" ng-click="$event.stopPropagation(); selectSeason(c);">
|
||||
<span ng-if="c.type === 'season' || c.type === 'album'" class="flex-pull-right" ng-click="$event.stopPropagation(); selectSeason(c);">
|
||||
<span class="fa fa-plus btn"></span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -4,14 +4,33 @@
|
||||
<div class="modal-content">
|
||||
<div>
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Program Config</h5>
|
||||
<h5 class="modal-title">Program Config (EPG)</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body container">
|
||||
<select ng-model="program.type" class="pull-right">
|
||||
<option>movie</option>
|
||||
<option>episode</option>
|
||||
<option>track</option>
|
||||
</select>
|
||||
<div ng-if="program.type === 'track'">
|
||||
<label>Track Title
|
||||
<span class="text-danger pull-right">{{error.title}}</span>
|
||||
</label>
|
||||
<input class="form-control form-control-sm" type="text" ng-model="program.title"/>
|
||||
<label>Subtitle</label>
|
||||
<input class="form-control form-control-sm" type="text" ng-model="program.subtitle"/>
|
||||
<label>Summary</label>
|
||||
<textarea class="form-control form-control-sm" ng-model="program.summary"></textarea>
|
||||
<label>Rating</label>
|
||||
<input class="form-control form-control-sm" type="text" ng-model="program.rating"/>
|
||||
<label>Icon</label>
|
||||
<input class="form-control form-control-sm" type="text" ng-model="program.icon"/>
|
||||
<h6>Icon Preview</h6>
|
||||
<div class="text-center">
|
||||
<img class="img" ng-src="{{program.icon}}" style="max-width: 200px;"/>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-if="program.type === 'movie'">
|
||||
<label>Movie Title
|
||||
<span class="text-danger pull-right">{{error.title}}</span>
|
||||
|
||||
@ -112,7 +112,7 @@ module.exports = function ($http, $window, $interval) {
|
||||
const res = await client.Get('/library/sections')
|
||||
var sections = []
|
||||
for (let i = 0, l = typeof res.Directory !== 'undefined' ? res.Directory.length : 0; i < l; i++)
|
||||
if (res.Directory[i].type === 'movie' || res.Directory[i].type === 'show') {
|
||||
if (res.Directory[i].type === 'movie' || res.Directory[i].type === 'show' || res.Directory[i].type === 'artist' ) {
|
||||
var genres = []
|
||||
if (res.Directory[i].type === 'movie') {
|
||||
const genresRes = await client.Get(`/library/sections/${res.Directory[i].key}/genre`)
|
||||
@ -142,13 +142,18 @@ module.exports = function ($http, $window, $interval) {
|
||||
const res = await client.Get('/playlists')
|
||||
var playlists = []
|
||||
for (let i = 0, l = typeof res.Metadata !== 'undefined' ? res.Metadata.length : 0; i < l; i++)
|
||||
if (res.Metadata[i].playlistType === 'video')
|
||||
if (
|
||||
(res.Metadata[i].playlistType === 'video')
|
||||
||
|
||||
(res.Metadata[i].playlistType === 'audio')
|
||||
) {
|
||||
playlists.push({
|
||||
title: res.Metadata[i].title,
|
||||
key: res.Metadata[i].key,
|
||||
icon: `${server.uri}${res.Metadata[i].composite}?X-Plex-Token=${server.accessToken}`,
|
||||
duration: res.Metadata[i].duration
|
||||
})
|
||||
}
|
||||
return playlists
|
||||
},
|
||||
getStreams: async (server, key) => {
|
||||
@ -180,6 +185,15 @@ module.exports = function ($http, $window, $interval) {
|
||||
continue
|
||||
if (res.Metadata[i].duration <= 0 && (res.Metadata[i].type === "episode" || res.Metadata[i].type === "movie"))
|
||||
continue
|
||||
let year = res.Metadata[i].year;
|
||||
if (typeof(year)==='undefined') {
|
||||
year = lib.year;
|
||||
}
|
||||
let date = res.Metadata[i].originallyAvailableAt;
|
||||
if ( (typeof(date)==='undefined') || (typeof(year)!=='undefined') ) {
|
||||
//albums don't have date , only year, so let's fill it
|
||||
date = `${year}-01-01`;
|
||||
}
|
||||
var program = {
|
||||
title: res.Metadata[i].title,
|
||||
key: res.Metadata[i].key,
|
||||
@ -192,10 +206,10 @@ module.exports = function ($http, $window, $interval) {
|
||||
subtitle: res.Metadata[i].subtitle,
|
||||
summary: res.Metadata[i].summary,
|
||||
rating: res.Metadata[i].contentRating,
|
||||
date: res.Metadata[i].originallyAvailableAt,
|
||||
year: res.Metadata[i].year,
|
||||
date: date,
|
||||
year: year,
|
||||
}
|
||||
if (program.type === 'episode' || program.type === 'movie') {
|
||||
if (program.type === 'episode' || program.type === 'movie' || program.type === 'track') {
|
||||
program.plexFile = `${res.Metadata[i].Media[0].Part[0].key}`
|
||||
program.file = `${res.Metadata[i].Media[0].Part[0].file}`
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user