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:
herby2212 2023-10-24 00:51:35 +02:00 committed by GitHub
parent 1e4fc05ecf
commit a31dcb5508
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 92 additions and 58 deletions

View file

@ -2854,6 +2854,30 @@ a .home-platforms-list-cover-face:hover
overflow: hidden;
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 {
padding-bottom: 10px;
float: none;

View file

@ -263,13 +263,17 @@ history_table_options = {
"targets": [12],
"data": "watched_status",
"createdCell": function (td, cellData, rowData, row, col) {
var circleValue = "";
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) {
$(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>');
} else {
$(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-half";
} else if (cellData == 0.25) {
circleValue = " circle-quarter";
}
$(td).html('<span class="watched-tooltip" data-toggle="tooltip" title="' + rowData['percent_complete'] + '%"><div class="circle' + circleValue + '" /></span>');
},
"searchable": false,
"orderable": false,

View file

@ -281,13 +281,19 @@ class DataFactory(object):
if item['live']:
item['percent_complete'] = 100
base_watched_value = watched_percent[item['media_type']] / 4.0
if helpers.check_watched(
item['media_type'], item['view_offset'], item['duration'],
item['marker_credits_first'], item['marker_credits_final']
):
watched_status = 1
elif item['percent_complete'] >= watched_percent[item['media_type']] / 2.0:
watched_status = 0.5
elif item['percent_complete'] >= base_watched_value * 3.0:
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:
watched_status = 0