mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-20 09:56:07 -05:00
Fix a whole bunch of eslint errors
These apparently were silent until 92c532d mass-upgraded deps.
Apparently eslint returned status 0 despite errors before and now
returns 1.
Most of these were handled by its "--fix" option; I manually took care
of the remaining two:
/Users/slamb/git/moonfire-nvr/ui-src/lib/views/RecordingsView.js
140:1 error This line has a length of 82. Maximum allowed is 80 max-len
/Users/slamb/git/moonfire-nvr/ui-src/lib/views/StreamSelectorView.js
72:1 error This line has a length of 82. Maximum allowed is 80 max-len
This commit is contained in:
@@ -138,9 +138,9 @@ export default class CalendarTSRange {
|
||||
* @return {Range90k} Range object or null if don't have start and end
|
||||
*/
|
||||
range90k() {
|
||||
return this.hasRange()
|
||||
? new Range90k(this.startTime90k, this.endTime90k)
|
||||
: null;
|
||||
return this.hasRange() ?
|
||||
new Range90k(this.startTime90k, this.endTime90k) :
|
||||
null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -167,9 +167,9 @@ export default class CalendarTSRange {
|
||||
*/
|
||||
_setRangeTime(range, dateStr, timeStr, dateOnlyThenEndOfDay) {
|
||||
const newTs90k = this._timeParser.parseDateTime90k(
|
||||
dateStr,
|
||||
timeStr,
|
||||
dateOnlyThenEndOfDay
|
||||
dateStr,
|
||||
timeStr,
|
||||
dateOnlyThenEndOfDay
|
||||
);
|
||||
if (newTs90k !== null) {
|
||||
range.dateStr = dateStr;
|
||||
|
||||
@@ -37,7 +37,7 @@ import Range from './Range';
|
||||
*
|
||||
* @type {WeakMap}
|
||||
*/
|
||||
let _range = new WeakMap();
|
||||
const _range = new WeakMap();
|
||||
|
||||
/**
|
||||
* Class like Range to represent ranges over timestamps in 90k format.
|
||||
@@ -94,8 +94,8 @@ export default class Range90k {
|
||||
*/
|
||||
trimmed(against) {
|
||||
return new Range90k(
|
||||
Math.max(this.startTime90k, against.startTime90k),
|
||||
Math.min(this.endTime90k, against.endTime90k)
|
||||
Math.max(this.startTime90k, against.startTime90k),
|
||||
Math.min(this.endTime90k, against.endTime90k)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ export default class Recording {
|
||||
* @return {Range90k} Resulting range
|
||||
*/
|
||||
range90k(trimmedAgainst = null) {
|
||||
let result = new Range90k(this.startTime90k, this.endTime90k);
|
||||
const result = new Range90k(this.startTime90k, this.endTime90k);
|
||||
return trimmedAgainst ? result.trimmed(trimmedAgainst) : result;
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -65,9 +65,9 @@ export default class Stream {
|
||||
*/
|
||||
get range90k() {
|
||||
return new Range90k(
|
||||
this.json_.minStartTime90k,
|
||||
this.json_.maxEndTime90k,
|
||||
this.json_.totalDuration90k
|
||||
this.json_.minStartTime90k,
|
||||
this.json_.maxEndTime90k,
|
||||
this.json_.totalDuration90k
|
||||
);
|
||||
}
|
||||
|
||||
@@ -94,11 +94,11 @@ export default class Stream {
|
||||
*/
|
||||
get days() {
|
||||
return new Map(
|
||||
Object.entries(this.json_.days).map(function(t) {
|
||||
let [k, v] = t;
|
||||
v = new Range90k(v.startTime90k, v.endTime90k, v.totalDuration90k);
|
||||
return [k, v];
|
||||
})
|
||||
Object.entries(this.json_.days).map(function(t) {
|
||||
let [k, v] = t;
|
||||
v = new Range90k(v.startTime90k, v.endTime90k, v.totalDuration90k);
|
||||
return [k, v];
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user