refactor: move getShareUrlPath to SharedLink class

This commit is contained in:
Damian Lesiuk 2025-10-10 20:41:34 +02:00
parent e9fe6941d5
commit 71f6fe9f27
4 changed files with 8 additions and 12 deletions

View file

@ -81,6 +81,11 @@ class SharedLink {
? dto.assets[0].id
: null;
String getShareUrlPath() {
final slug = this.slug?.trim();
return slug?.isNotEmpty == true ? 's/$slug' : 'share/$key';
}
@override
String toString() =>
'SharedLink(id=$id, title=$title, thumbAssetId=$thumbAssetId, allowDownload=$allowDownload, allowUpload=$allowUpload, description=$description, password=$password, expiresAt=$expiresAt, key=$key, showMetadata=$showMetadata, slug=$slug, type=$type)';