mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 05:31:15 -07:00
Quater values for History Watch Status (#2179)
* initial release * change fillup orientation to clockwise * fix indentation for css * fix 50 percent circle orientation * optimize colors and padding
This commit is contained in:
parent
1e4fc05ecf
commit
a31dcb5508
3 changed files with 92 additions and 58 deletions
|
@ -2854,6 +2854,30 @@ a .home-platforms-list-cover-face:hover
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
max-width: 350px;
|
max-width: 350px;
|
||||||
}
|
}
|
||||||
|
.circle {
|
||||||
|
width: 1.55rem;
|
||||||
|
height: 1.55rem;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 0.2rem solid #eeeeee;
|
||||||
|
}
|
||||||
|
.circle-quarter {
|
||||||
|
background-image:
|
||||||
|
linear-gradient(00deg, #2b2b2b 50%, transparent 50%),
|
||||||
|
linear-gradient(270deg, #eeeeee 50%, transparent 50%);
|
||||||
|
}
|
||||||
|
.circle-half {
|
||||||
|
background-image:
|
||||||
|
linear-gradient(90deg, #2b2b2b 50%, transparent 50%),
|
||||||
|
linear-gradient(-90deg, #eeeeee 50%, transparent 50%);
|
||||||
|
}
|
||||||
|
.circle-three-quarter {
|
||||||
|
background-image:
|
||||||
|
linear-gradient(180deg, transparent 50%, #eeeeee 50%),
|
||||||
|
linear-gradient(-90deg, #eeeeee 50%, transparent 50%);
|
||||||
|
}
|
||||||
|
.circle-full {
|
||||||
|
background: #eeeeee;
|
||||||
|
}
|
||||||
#graph-tabs {
|
#graph-tabs {
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
float: none;
|
float: none;
|
||||||
|
|
|
@ -263,13 +263,17 @@ history_table_options = {
|
||||||
"targets": [12],
|
"targets": [12],
|
||||||
"data": "watched_status",
|
"data": "watched_status",
|
||||||
"createdCell": function (td, cellData, rowData, row, col) {
|
"createdCell": function (td, cellData, rowData, row, col) {
|
||||||
|
var circleValue = "";
|
||||||
if (cellData == 1) {
|
if (cellData == 1) {
|
||||||
$(td).html('<span class="watched-tooltip" data-toggle="tooltip" title="' + rowData['percent_complete'] + '%"><i class="fa fa-lg fa-circle"></i></span>');
|
circleValue = " circle-full";
|
||||||
|
} else if (cellData == 0.75) {
|
||||||
|
circleValue = " circle-three-quarter";
|
||||||
} else if (cellData == 0.5) {
|
} else if (cellData == 0.5) {
|
||||||
$(td).html('<span class="watched-tooltip" data-toggle="tooltip" title="' + rowData['percent_complete'] + '%"><i class="fa fa-lg fa-adjust fa-rotate-180"></i></span>');
|
circleValue = " circle-half";
|
||||||
} else {
|
} else if (cellData == 0.25) {
|
||||||
$(td).html('<span class="watched-tooltip" data-toggle="tooltip" title="' + rowData['percent_complete'] + '%"><i class="fa fa-lg fa-circle-o"></i></span>');
|
circleValue = " circle-quarter";
|
||||||
}
|
}
|
||||||
|
$(td).html('<span class="watched-tooltip" data-toggle="tooltip" title="' + rowData['percent_complete'] + '%"><div class="circle' + circleValue + '" /></span>');
|
||||||
},
|
},
|
||||||
"searchable": false,
|
"searchable": false,
|
||||||
"orderable": false,
|
"orderable": false,
|
||||||
|
|
|
@ -281,13 +281,19 @@ class DataFactory(object):
|
||||||
if item['live']:
|
if item['live']:
|
||||||
item['percent_complete'] = 100
|
item['percent_complete'] = 100
|
||||||
|
|
||||||
|
base_watched_value = watched_percent[item['media_type']] / 4.0
|
||||||
|
|
||||||
if helpers.check_watched(
|
if helpers.check_watched(
|
||||||
item['media_type'], item['view_offset'], item['duration'],
|
item['media_type'], item['view_offset'], item['duration'],
|
||||||
item['marker_credits_first'], item['marker_credits_final']
|
item['marker_credits_first'], item['marker_credits_final']
|
||||||
):
|
):
|
||||||
watched_status = 1
|
watched_status = 1
|
||||||
elif item['percent_complete'] >= watched_percent[item['media_type']] / 2.0:
|
elif item['percent_complete'] >= base_watched_value * 3.0:
|
||||||
watched_status = 0.5
|
watched_status = 0.75
|
||||||
|
elif item['percent_complete'] >= base_watched_value * 2.0:
|
||||||
|
watched_status = 0.50
|
||||||
|
elif item['percent_complete'] >= base_watched_value:
|
||||||
|
watched_status = 0.25
|
||||||
else:
|
else:
|
||||||
watched_status = 0
|
watched_status = 0
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue