Merge pull request #249 from vexorian/20210123_dev

Music Libraries UI
This commit is contained in:
vexorian 2021-01-23 20:44:08 -04:00 committed by GitHub
commit da8ac07567
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 9 deletions

View File

@ -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;

View File

@ -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>

View File

@ -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>

View File

@ -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}`
}