Convert filesize to float64 for arm32 (#1895)

* Convert filesize to float64 for arm32
This commit is contained in:
kermieisinthehouse 2021-10-26 17:55:11 -07:00 committed by GitHub
parent 2136ced25c
commit 5de06d4b62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 7 deletions

View File

@ -73,6 +73,6 @@ type FindImagesResultType {
"""Total megapixels of the images"""
megapixels: Float!
"""Total file size in bytes"""
filesize: Int!
filesize: Float!
images: [Image!]!
}

View File

@ -123,7 +123,7 @@ type FindScenesResultType {
"""Total duration in seconds"""
duration: Float!
"""Total file size in bytes"""
filesize: Int!
filesize: Float!
scenes: [Scene!]!
}

View File

@ -78,7 +78,7 @@ func (r *queryResolver) FindScenes(ctx context.Context, sceneFilter *models.Scen
result.Count = len(scenes)
for _, s := range scenes {
result.TotalDuration += s.Duration.Float64
size, _ := strconv.Atoi(s.Size.String)
size, _ := strconv.ParseFloat(s.Size.String, 64)
result.TotalSize += size
}
}

View File

@ -11,7 +11,7 @@ type ImageQueryOptions struct {
type ImageQueryResult struct {
QueryResult
Megapixels float64
TotalSize int
TotalSize float64
finder ImageFinder
images []*Image

View File

@ -11,7 +11,7 @@ type SceneQueryOptions struct {
type SceneQueryResult struct {
QueryResult
TotalDuration float64
TotalSize int
TotalSize float64
finder SceneFinder
scenes []*Scene

View File

@ -330,7 +330,7 @@ func (qb *imageQueryBuilder) queryGroupedFields(options models.ImageQueryOptions
out := struct {
Total int
Megapixels float64
Size int
Size float64
}{}
if err := qb.repository.queryStruct(aggregateQuery.toSQL(includeSortPagination), query.args, &out); err != nil {
return nil, err

View File

@ -469,7 +469,7 @@ func (qb *sceneQueryBuilder) queryGroupedFields(options models.SceneQueryOptions
out := struct {
Total int
Duration float64
Size int
Size float64
}{}
if err := qb.repository.queryStruct(aggregateQuery.toSQL(includeSortPagination), query.args, &out); err != nil {
return nil, err