mirror of
https://github.com/jagandeepbrar/lunasea.git
synced 2026-08-31 12:42:34 +00:00
NEW - [Quick Actions] Enable home screen quick actions to quickly launch into up to 4 modules - [Tautulli/User] Implemented user pages including profile, history, synced, and IP addresses - [Settings/Resources] Added link to join TestFlight TWEAKS - [Home/Modules] Slightly adjusted design of quick links - [Settings] Slightly adjusted design of module tiles FIXES - [Home/Modules] Search tile would not show up after adding first indexer until a route change - [Tautulli/Activity] Tautulli could show an incorrect transcode container
36 lines
1.3 KiB
Dart
36 lines
1.3 KiB
Dart
import 'package:lunasea/core.dart';
|
|
|
|
extension DurationExtension on Duration {
|
|
/// Creates a HH:MM:SS timestamp
|
|
//ignore: non_constant_identifier_names
|
|
String lsDuration_timestamp() {
|
|
String hours = this.inHours.toString().padLeft(2, '0');
|
|
String minutes = (this.inMinutes%60).toString().padLeft(2, '0');
|
|
String seconds = (this.inSeconds%60).toString().padLeft(2, '0');
|
|
return [
|
|
if(hours != '00') '$hours:',
|
|
'$minutes:',
|
|
'$seconds',
|
|
].join();
|
|
}
|
|
|
|
|
|
/// Creates a full timestamp, akin to 1 Day, 23 Hours, 10 Minutes
|
|
//ignore: non_constant_identifier_names
|
|
String lsDuration_fullTimestamp() {
|
|
String days, hours, minutes;
|
|
if(this.inDays == 1) days = '1 Day ';
|
|
if(this.inDays > 1) days = '${this.inDays.toString()} Days ';
|
|
if(this.inHours == 1) hours = '1 Hour ';
|
|
if(this.inHours > 1) hours = '${(this.inHours%24).toString()} Hours ';
|
|
if(this.inMinutes == 1) minutes = '1 Minute ';
|
|
if(this.inMinutes > 1) minutes = '${(this.inMinutes%60).toString()} Minutes ';
|
|
return [
|
|
if(days != null) days,
|
|
if(hours != null) hours,
|
|
if(minutes != null) minutes,
|
|
if(minutes == null) Constants.TEXT_EMDASH,
|
|
].join();
|
|
}
|
|
}
|