WIP: storage-fix-local-nas work before playlist controls feature
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
6b3ab5b65e
commit
c160242dbc
46 files changed
+5365
-815
No files matched your search
@@ -43,13 +43,12 @@ class Playlist extends Model
|
||||
}
|
||||
|
||||
// Accessors
|
||||
public function getThumbnailUrlAttribute()
|
||||
public function getThumbnailUrlAttribute(): string
|
||||
{
|
||||
if ($this->thumbnail) {
|
||||
return asset('storage/thumbnails/'.$this->thumbnail);
|
||||
return route('media.thumbnail', $this->thumbnail);
|
||||
}
|
||||
|
||||
// Generate a placeholder based on playlist name
|
||||
return 'https://ui-avatars.com/api/?name='.urlencode($this->name).'&background=random&size=200';
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -46,6 +46,10 @@ class Post extends Model
|
||||
|
||||
public function getImageUrlAttribute(): ?string
|
||||
{
|
||||
return $this->image ? asset('storage/post_images/' . $this->image) : null;
|
||||
if (! $this->image) return null;
|
||||
if (str_starts_with($this->image, 'users/')) {
|
||||
return route('media.post-image', $this->image);
|
||||
}
|
||||
return asset('storage/post_images/' . $this->image);
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,9 @@ class PostImage extends Model
|
||||
|
||||
public function getImageUrlAttribute(): string
|
||||
{
|
||||
if (str_starts_with($this->filename, 'users/')) {
|
||||
return route('media.post-image', $this->filename);
|
||||
}
|
||||
return asset('storage/post_images/' . $this->filename);
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -123,10 +123,10 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
return $this->hasMany(\App\Models\Post::class);
|
||||
}
|
||||
|
||||
public function getAvatarUrlAttribute()
|
||||
public function getAvatarUrlAttribute(): string
|
||||
{
|
||||
if ($this->avatar) {
|
||||
return asset('storage/avatars/'.$this->avatar);
|
||||
return route('media.avatar', $this->avatar);
|
||||
}
|
||||
|
||||
return 'https://i.pravatar.cc/150?u='.$this->id;
|
||||
@@ -135,7 +135,7 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
public function getBannerUrlAttribute(): ?string
|
||||
{
|
||||
if ($this->banner) {
|
||||
return asset('storage/banners/'.$this->banner);
|
||||
return route('media.banner', $this->banner);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user