mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 20:59:03 +00:00
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:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
// }
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user