fix

package
v1.10.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package fix contains functions for repairing the database data.

Index

Constants

View Source
const Trainer = "gamehack"
View Source
const (
	UpdateSet = "UPDATE files SET "
)

Variables

View Source
var ErrRepair = errors.New("invalid repair option")
View Source
var FixesMap = map[string]string{
	// contains filtered or unexported fields
}
View Source
var (
	FixesMapUpper map[string]string
)

Functions

func GetFixesMapUpper added in v1.10.3

func GetFixesMapUpper() map[string]string

GetFixesMapUpper lazily initializes and returns the uppercase fixes map.

func Magics added in v0.17.0

func Magics(exec boil.ContextExecutor) error

Magics will set invalid file_magic_type to NULL. Invalid file_magic_type values are those that start with "ERROR: " or contain a "/" such as a mime-type.

func SyncFilesIDSeq added in v1.0.6

func SyncFilesIDSeq(db *sql.DB) error

SyncFilesIDSeq will synchronize the files ID sequence with the current maximum ID.

This will only work with the correct database account permissions.

Types

type FilesWithNumericSuffix added in v1.10.4

type FilesWithNumericSuffix struct {
	Count int64               `boil:"-" json:"count"`
	Files []NumericSuffixFile `boil:"-" json:"files"`
}

FilesWithNumericSuffix represents files that have numeric suffixes that need fixing.

func GetFilesWithNumericSuffix added in v1.10.4

func GetFilesWithNumericSuffix(ctx context.Context, exec boil.ContextExecutor) (*FilesWithNumericSuffix, error)

GetFilesWithNumericSuffix retrieves files with numeric suffixes from the database.

type NumericSuffixCount added in v1.10.4

type NumericSuffixCount struct {
	Count int64 `boil:"files_with_numeric_suffix" json:"count"`
}

NumericSuffixCount represents the count of files with numeric suffixes.

type NumericSuffixFile added in v1.10.4

type NumericSuffixFile struct {
	ID           int64  `boil:"id"                        json:"id"`
	UUID         string `boil:"uuid"                      json:"uuid"`
	Filename     string `boil:"files_with_numeric_suffix" json:"filename"`
	ObfuscatedID string `boil:"-"                         json:"obfuscatedId"`
}

NumericSuffixFile represents a file with a numeric suffix.

type Repair

type Repair int

Repair a column or type of data within the database.

const (
	// None does nothing.
	None Repair = iota - 1
	// Artifacts repairs all the artifact data.
	Artifacts
	// Releaser focuses on the releaser data using the group_brand_by and group_brand_for columns.
	Releaser
)

func (Repair) Run

func (r Repair) Run(ctx context.Context, db *sql.DB, tx *sql.Tx, sl *slog.Logger) error

Run the database repair based on the repair option.

func (Repair) String added in v0.8.0

func (r Repair) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL