Remove Thumbnail Preferences. (#1200)

* Remove thumbnail preferences. #1089

* Remove thumbnail preferences test.

* Remove thumbnail preferences from backend.

* Fix database.go

* Update generated TS files.

* Reorder the migrations.
This commit is contained in:
Googol Lee
2025-05-11 10:44:58 +02:00
committed by GitHub
parent 27a0b082d1
commit fe3cc16026
15 changed files with 32 additions and 625 deletions

View File

@@ -8,8 +8,6 @@ type SiteInfo {
periodicScanInterval: Int! @isAdmin
"How many max concurrent scanner jobs that should run at once"
concurrentWorkers: Int! @isAdmin
"The filter to use when generating thumbnails"
thumbnailMethod: ThumbnailFilter! @isAdmin
}
extend type Query {

View File

@@ -1,43 +0,0 @@
package resolvers
// This file will be automatically regenerated based on the schema, any resolver implementations
// will be copied through when generating and any unknown code will be moved to the end.
// Code generated by github.com/99designs/gqlgen version v0.17.73
import (
"context"
"github.com/photoview/photoview/api/graphql/models"
"gorm.io/gorm"
)
// SetThumbnailDownsampleMethod is the resolver for the setThumbnailDownsampleMethod field.
func (r *mutationResolver) SetThumbnailDownsampleMethod(ctx context.Context, method models.ThumbnailFilter) (models.ThumbnailFilter, error) {
db := r.DB(ctx)
// if method > 5 {
// return 0, errors.New("The requested filter is unsupported, defaulting to nearest neighbor")
// }
if err := db.
Session(&gorm.Session{AllowGlobalUpdate: true}).
Model(&models.SiteInfo{}).
Update("thumbnail_method", method).
Error; err != nil {
return models.ThumbnailFilterNearestNeighbor, err
}
var siteInfo models.SiteInfo
if err := db.First(&siteInfo).Error; err != nil {
return models.ThumbnailFilterNearestNeighbor, err
}
return siteInfo.ThumbnailMethod, nil
// var langTrans *models.LanguageTranslation = nil
// if language != nil {
// lng := models.LanguageTranslation(*language)
// langTrans = &lng
// }
}

View File

@@ -1,14 +0,0 @@
"Supported downsampling filters for thumbnail generation"
enum ThumbnailFilter {
NearestNeighbor,
Box,
Linear,
MitchellNetravali,
CatmullRom,
Lanczos,
}
extend type Mutation {
"Set the filter to be used when generating thumbnails"
setThumbnailDownsampleMethod(method: ThumbnailFilter!): ThumbnailFilter! @isAdmin
}