mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Fix integer overflow for scene size on 32bit systems (#994)
* Fix integer overflow for scene size on 32bit systems * Cast to double in sqlite to prevent potential overflow * Add migration to reset scene sizes and scan logic to repopulate if empty
This commit is contained in:
@@ -254,8 +254,8 @@ func (qb *SceneQueryBuilder) Count() (int, error) {
|
||||
return runCountQuery(buildCountQuery("SELECT scenes.id FROM scenes"), nil)
|
||||
}
|
||||
|
||||
func (qb *SceneQueryBuilder) Size() (uint64, error) {
|
||||
return runSumQuery("SELECT SUM(size) as sum FROM scenes", nil)
|
||||
func (qb *SceneQueryBuilder) Size() (float64, error) {
|
||||
return runSumQuery("SELECT SUM(cast(size as double)) as sum FROM scenes", nil)
|
||||
}
|
||||
|
||||
func (qb *SceneQueryBuilder) CountByStudioID(studioID int) (int, error) {
|
||||
|
||||
Reference in New Issue
Block a user