mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix: The 'Copy Link' function will prioritize copying any available custom URL, mirroring the behavior found on the web version
This commit is contained in:
parent
27bc8eba7b
commit
7af9d6d7b7
7 changed files with 502 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:immich_mobile/domain/models/store.model.dart';
|
||||
import 'package:immich_mobile/entities/store.entity.dart';
|
||||
import 'package:immich_mobile/models/shared_link/shared_link.model.dart';
|
||||
import 'package:punycode/punycode.dart';
|
||||
|
||||
String sanitizeUrl(String url) {
|
||||
|
|
@ -90,3 +91,12 @@ String? punycodeDecodeUrl(String? serverUrl) {
|
|||
|
||||
return Uri.decodeFull(serverUri.replace(host: decodedHost).toString());
|
||||
}
|
||||
|
||||
/// Generates the appropriate share URL path for a given shared link.
|
||||
///
|
||||
/// Returns a path string based on the shared link's slug and key:
|
||||
/// - If slug is present: 's/${sharedLink.slug}'
|
||||
/// - Otherwise: 'share/${sharedLink.key}'
|
||||
String getShareUrlPath(SharedLink sharedLink) {
|
||||
return sharedLink.slug != null ? 's/${sharedLink.slug}' : 'share/${sharedLink.key}';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue