mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 20:59:03 +00:00
Move album cover options from sidebar/Sharing.tsx
...to AlbumSidebar.tsx and MediaSidebar.tsx instead. Fix API tests for Postgresql
This commit is contained in:
@@ -95,7 +95,7 @@ func (a *Album) Thumbnail(db *gorm.DB) (*Media, error) {
|
||||
SELECT id FROM sub_albums
|
||||
) AND media.id IN (
|
||||
SELECT media_id FROM media_urls WHERE media_urls.media_id = media.id
|
||||
) LIMIT 1
|
||||
) ORDER BY id LIMIT 1
|
||||
`, a.ID).Find(&media).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -175,7 +175,6 @@ func (r *mutationResolver) ResetAlbumCover(ctx context.Context, albumID int) (*m
|
||||
return actions.ResetAlbumCover(r.Database, user, albumID)
|
||||
}
|
||||
|
||||
// Takes media.id, finds parent album, sets album.cover_id to media.id (must be a more efficient way of doing this, but it works)
|
||||
func (r *mutationResolver) SetAlbumCover(ctx context.Context, mediaID int) (*models.Album, error) {
|
||||
user := auth.UserFromContext(ctx)
|
||||
if user == nil {
|
||||
|
||||
Reference in New Issue
Block a user