mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 21:51:14 -07:00
Add tracks to user recently watched
* Clean up poster styles to match info pages
This commit is contained in:
parent
5eebf6592a
commit
5ec9e41244
4 changed files with 154 additions and 62 deletions
|
@ -778,36 +778,88 @@ a .dashboard-activity-metadata-user-thumb:hover {
|
|||
font-weight: bold;
|
||||
color: #F9AA03;
|
||||
}
|
||||
/*.dashboard-activity-instance-overlay {
|
||||
position: relative;
|
||||
top: -12px;
|
||||
text-align: left;
|
||||
height: 53px;
|
||||
width: 250px;
|
||||
border-radius: 0 0 3px 3px;
|
||||
}*/
|
||||
.dashboard-recent-media-row {
|
||||
width: 100%;
|
||||
margin:0 auto;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
}
|
||||
.dashboard-recent-media {
|
||||
width: 100%;
|
||||
margin: auto;
|
||||
list-style: none;
|
||||
}
|
||||
.dashboard-recent-media-instance {
|
||||
}
|
||||
.dashboard-recent-media li {
|
||||
margin-right: 27px;
|
||||
float: left;
|
||||
position: relative;
|
||||
left: 0px;
|
||||
margin-right: 25px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.dashboard-recent-media-poster {
|
||||
position: relative;
|
||||
float: left;
|
||||
min-height: 340px;
|
||||
}
|
||||
.dashboard-recent-media-cover {
|
||||
position: relative;
|
||||
margin-top: 75px;
|
||||
float: left;
|
||||
}
|
||||
a:hover .dashboard-recent-media-poster,
|
||||
a:hover .dashboard-recent-media-cover {
|
||||
webkit-box-shadow: inset 0 0 0 2px #e9a049;
|
||||
-moz-box-shadow: inset 0 0 0 2px #e9a049;
|
||||
box-shadow: inset 0 0 0 2px #e9a049;
|
||||
}
|
||||
.dashboard-recent-media-poster-face {
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
height: 225px;
|
||||
width: 150px;
|
||||
position: relative;
|
||||
-webkit-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1);
|
||||
-moz-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1);
|
||||
box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1);
|
||||
z-index: -2;
|
||||
}
|
||||
.dashboard-recent-media-cover-face {
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
height: 150px;
|
||||
width: 150px;
|
||||
position: relative;
|
||||
-webkit-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1);
|
||||
-moz-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1);
|
||||
box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1);
|
||||
z-index: -2;
|
||||
}
|
||||
.dashboard-recent-media-overlay {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
text-align: left;
|
||||
background: -moz-linear-gradient(top, rgba(0,0,0,0) 30%, rgba(0,0,0,1) 100%);
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(30%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,1)));
|
||||
background: -webkit-linear-gradient(top, rgba(0,0,0,0) 30%,rgba(0,0,0,1) 100%);
|
||||
background: -o-linear-gradient(top, rgba(0,0,0,0) 30%,rgba(0,0,0,1) 100%);
|
||||
background: -ms-linear-gradient(top, rgba(0,0,0,0) 30%,rgba(0,0,0,1) 100%);
|
||||
background: linear-gradient(to bottom, rgba(0,0,0,0) 30%,rgba(0,0,0,1) 100%);
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
}
|
||||
.dashboard-recent-media-overlay-text {
|
||||
color: #aaa;
|
||||
font-size: 12px;
|
||||
float: left;
|
||||
position: absolute;
|
||||
left: 8px;
|
||||
bottom: 5px;
|
||||
}
|
||||
.dashboard-recent-media-metacontainer {
|
||||
width: 150px;
|
||||
font-size: 13px;
|
||||
margin-bottom: 20px;
|
||||
clear: both;
|
||||
}
|
||||
.dashboard-recent-media-metacontainer h3 {
|
||||
|
@ -825,6 +877,9 @@ a .dashboard-activity-metadata-user-thumb:hover {
|
|||
text-align: left;
|
||||
clear: both;
|
||||
}
|
||||
.dashboard-recent-media-metacontainer h3.text-muted {
|
||||
color: #777;
|
||||
}
|
||||
.dashboard-recent-media-metacontainer .text-muted {
|
||||
padding: 5px 3px 0 3px;
|
||||
text-overflow: ellipsis;
|
||||
|
|
|
@ -31,37 +31,48 @@ DOCUMENTATION :: END
|
|||
<li>
|
||||
% if item['type'] == 'season' or item['type'] == 'movie':
|
||||
<a href="info?item_id=${item['rating_key']}">
|
||||
<div class="poster">
|
||||
<div class="poster-face" style="background-image: url(pms_image_proxy?img=${item['thumb']}&width=300&height=450&fallback=poster);"></div>
|
||||
<div class="dashboard-recent-media-poster">
|
||||
<div class="dashboard-recent-media-poster-face" style="background-image: url(pms_image_proxy?img=${item['thumb']}&width=300&height=450&fallback=poster);">
|
||||
<div class="dashboard-recent-media-overlay">
|
||||
<div class="dashboard-recent-media-overlay-text" id="added_at-${item['rating_key']}">
|
||||
<script>
|
||||
$('#added_at-${item['rating_key']}').text('Added ' + moment(${item['added_at']}, "X").fromNow())
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dashboard-recent-media-metacontainer">
|
||||
% if item['type'] == 'season':
|
||||
<h3>${item['parent_title']}</h3>
|
||||
<h3>(${item['title']})</h3>
|
||||
<h3 class="text-muted">${item['title']}</h3>
|
||||
% elif item['type'] == 'movie':
|
||||
<h3>${item['title']}</h3>
|
||||
<h3>(${item['year']})</h3>
|
||||
<h3 class="text-muted">${item['year']}</h3>
|
||||
% endif
|
||||
<div class="text-muted" id="added_at-${item['rating_key']}">${item['added_at']}</div>
|
||||
</div>
|
||||
</a>
|
||||
% elif item['type'] == 'album':
|
||||
<a href="info?item_id=${item['rating_key']}">
|
||||
<div class="poster">
|
||||
<div class="cover-face" style="background-image: url(pms_image_proxy?img=${item['thumb']}&width=300&height=300&fallback=cover);"></div>
|
||||
<div class="dashboard-recent-media-cover">
|
||||
<div class="dashboard-recent-media-cover-face" style="background-image: url(pms_image_proxy?img=${item['thumb']}&width=300&height=300&fallback=cover);">
|
||||
<div class="dashboard-recent-media-overlay">
|
||||
<div class="dashboard-recent-media-overlay-text" id="added_at-${item['rating_key']}">
|
||||
<script>
|
||||
$('#added_at-${item['rating_key']}').text('Added ' + moment(${item['added_at']}, "X").fromNow())
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dashboard-recent-media-metacontainer">
|
||||
<h3>${item['parent_title']}</h3>
|
||||
<h3>${item['title']}</h3>
|
||||
<div class="text-muted" id="added_at-${item['rating_key']}">${item['added_at']}</div>
|
||||
<h3 class="text-muted">${item['title']}</h3>
|
||||
</div>
|
||||
</a>
|
||||
% endif
|
||||
</li>
|
||||
</div>
|
||||
<script>
|
||||
$('#added_at-${item['rating_key']}').html('Added ' + moment(${item['added_at']}, "X").fromNow())
|
||||
</script>
|
||||
% endfor
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -32,29 +32,54 @@ DOCUMENTATION :: END
|
|||
<div class="dashboard-recent-media-row">
|
||||
<ul class="dashboard-recent-media list-unstyled">
|
||||
% for item in data:
|
||||
<div class="dashboard-recent-media-instance">
|
||||
<li>
|
||||
<a href="info?source=history&item_id=${item['row_id']}">
|
||||
<div class="poster">
|
||||
<div class="poster-face" style="background-image: url(pms_image_proxy?img=${item['thumb']}&width=300&height=450&fallback=poster);"></div>
|
||||
<li>
|
||||
% if item['type'] == 'episode' or item['type'] == 'movie':
|
||||
<a href="info?source=history&item_id=${item['row_id']}">
|
||||
<div class="dashboard-recent-media-poster">
|
||||
<div class="dashboard-recent-media-poster-face" style="background-image: url(pms_image_proxy?img=${item['thumb']}&width=300&height=450&fallback=poster);">
|
||||
<div class="dashboard-recent-media-overlay">
|
||||
<div class="dashboard-recent-media-overlay-text" id="time-${item['time']}">
|
||||
<script>
|
||||
$('#time-${item['time']}').text('Watched ' + moment(${item['time']}, "X").fromNow())
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dashboard-recent-media-metacontainer">
|
||||
% if item['type'] == 'episode':
|
||||
<h3>${item['parent_title']}</h3>
|
||||
<h3>${item['title']}</h3>
|
||||
<h3>(Season ${item['parent_index']}, Episode ${item['index']})</h3>
|
||||
% elif item['type'] == 'movie':
|
||||
<h3>${item['title']}</h3>
|
||||
<h3>(${item['year']})</h3>
|
||||
% endif
|
||||
<div class="text-muted" id="time-${item['time']}">${item['time']}</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
<script>
|
||||
$('#time-${item['time']}').html('Watched ' + moment(${item['time']}, "X").fromNow())
|
||||
</script>
|
||||
</div>
|
||||
<div class="dashboard-recent-media-metacontainer">
|
||||
% if item['type'] == 'episode':
|
||||
<h3>${item['grandparent_title']}</h3>
|
||||
<h3>${item['title']}</h3>
|
||||
<h3 class="text-muted">S${item['parent_index']} · E${item['index']}</h3>
|
||||
% elif item['type'] == 'movie':
|
||||
<h3>${item['title']}</h3>
|
||||
<h3 class="text-muted">${item['year']}</h3>
|
||||
% endif
|
||||
<div class="text-muted" id="time-${item['time']}">
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
% elif item['type'] == 'track':
|
||||
<a href="info?source=history&item_id=${item['row_id']}">
|
||||
<div class="dashboard-recent-media-cover">
|
||||
<div class="dashboard-recent-media-cover-face" style="background-image: url(pms_image_proxy?img=${item['thumb']}&width=300&height=300&fallback=cover);">
|
||||
<div class="dashboard-recent-media-overlay">
|
||||
<div class="dashboard-recent-media-overlay-text" id="time-${item['time']}">
|
||||
<script>
|
||||
$('#time-${item['time']}').text('Watched ' + moment(${item['time']}, "X").fromNow())
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dashboard-recent-media-metacontainer">
|
||||
<h3>${item['grandparent_title']}</h3>
|
||||
<h3>${item['title']}</h3>
|
||||
<h3 class="text-muted">${item['parent_title']}</h3>
|
||||
</div>
|
||||
</a>
|
||||
% endif
|
||||
</li>
|
||||
% endfor
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -524,23 +524,23 @@ class DataFactory(object):
|
|||
|
||||
try:
|
||||
if user_id:
|
||||
query = 'SELECT session_history.id, session_history.media_type, session_history.rating_key, title, ' \
|
||||
query = 'SELECT session_history.id, session_history.media_type, session_history.rating_key, title, parent_title, ' \
|
||||
'grandparent_title, thumb, parent_thumb, grandparent_thumb, media_index, parent_media_index, year, started, user ' \
|
||||
'FROM session_history_metadata ' \
|
||||
'JOIN session_history ON session_history_metadata.id = session_history.id ' \
|
||||
'WHERE user_id = ? AND session_history.media_type != "track" ORDER BY started DESC LIMIT ?'
|
||||
'WHERE user_id = ? ORDER BY started DESC LIMIT ?'
|
||||
result = monitor_db.select(query, args=[user_id, limit])
|
||||
elif user:
|
||||
query = 'SELECT session_history.id, session_history.media_type, session_history.rating_key, title, ' \
|
||||
query = 'SELECT session_history.id, session_history.media_type, session_history.rating_key, title, parent_title, ' \
|
||||
'grandparent_title, thumb, parent_thumb, grandparent_thumb, media_index, parent_media_index, year, started, user ' \
|
||||
'FROM session_history_metadata ' \
|
||||
'JOIN session_history ON session_history_metadata.id = session_history.id ' \
|
||||
'WHERE user = ? AND session_history.media_type != "track" ORDER BY started DESC LIMIT ?'
|
||||
'WHERE user = ? ORDER BY started DESC LIMIT ?'
|
||||
result = monitor_db.select(query, args=[user, limit])
|
||||
else:
|
||||
query = 'SELECT session_history.id, session_history.media_type, session_history.rating_key, title, ' \
|
||||
query = 'SELECT session_history.id, session_history.media_type, session_history.rating_key, title, parent_title, ' \
|
||||
'grandparent_title, thumb, parent_thumb, grandparent_thumb, media_index, parent_media_index, year, started, user ' \
|
||||
'FROM session_history_metadata WHERE session_history.media_type != "track"' \
|
||||
'FROM session_history_metadata ' \
|
||||
'JOIN session_history ON session_history_metadata.id = session_history.id ' \
|
||||
'ORDER BY started DESC LIMIT ?'
|
||||
result = monitor_db.select(query, args=[limit])
|
||||
|
@ -549,24 +549,25 @@ class DataFactory(object):
|
|||
return None
|
||||
|
||||
for row in result:
|
||||
if row[1] == 'episode' and row[6]:
|
||||
thumb = row[6]
|
||||
elif row[1] == 'episode':
|
||||
if row[1] == 'episode' and row[7]:
|
||||
thumb = row[7]
|
||||
elif row[1] == 'episode':
|
||||
thumb = row[8]
|
||||
else:
|
||||
thumb = row[5]
|
||||
thumb = row[6]
|
||||
|
||||
recent_output = {'row_id': row[0],
|
||||
'type': row[1],
|
||||
'rating_key': row[2],
|
||||
'title': row[3],
|
||||
'parent_title': row[4],
|
||||
'grandparent_title': row[5],
|
||||
'thumb': thumb,
|
||||
'index': row[8],
|
||||
'parent_index': row[9],
|
||||
'year': row[10],
|
||||
'time': row[11],
|
||||
'user': row[12]
|
||||
'index': row[9],
|
||||
'parent_index': row[10],
|
||||
'year': row[11],
|
||||
'time': row[12],
|
||||
'user': row[13]
|
||||
}
|
||||
recently_watched.append(recent_output)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue