mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
tweaks (#1810)
* tweak * opt: image quality * opt: VideoPlayerServiceHandler * fixes * update Signed-off-by: dom <githubaccount56556@proton.me> * fix get file name Signed-off-by: dom <githubaccount56556@proton.me> --------- Co-authored-by: dom <githubaccount56556@proton.me>
This commit is contained in:
committed by
GitHub
parent
219228f8b5
commit
038f03a4e7
@@ -162,9 +162,14 @@ abstract final class Utils {
|
||||
return randomBase64.substring(0, randomBase64.length - 2);
|
||||
}
|
||||
|
||||
static int _getExt(String uri) {
|
||||
final i = uri.indexOf('?');
|
||||
return i == -1 ? uri.length : i;
|
||||
}
|
||||
|
||||
static String getFileName(String uri, {bool fileExt = true}) {
|
||||
final i0 = uri.lastIndexOf('/') + 1;
|
||||
final i1 = fileExt ? uri.length : uri.lastIndexOf('.');
|
||||
final i1 = fileExt ? _getExt(uri) : uri.lastIndexOf('.');
|
||||
return uri.substring(i0, i1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user