soxx 6f814e5b21
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 3m8s
refactor: unified migrations and Tag* ID Changes
- unified the migrations
- added new IDs for Tag, TagAlias, TagGroup
- changed relevant functions to use the given IDs

BREAKING-CHANGE: Database needs to be cleared or migrated. Not compatible with Database v5
2025-01-28 13:27:11 +01:00

89 lines
1.6 KiB
Go

package models
import "time"
type (
UserID string
PostID string
PostURL string
PoolID string
SourceID string
SourceDomain string
TagName string
TagID int64
TagGroupName string
TagGroupID int64
TagAliasName string
TagAliasID int64
ScrapeTimeInterval int
UserLastScrapeTime time.Time
Rating string
TagType string
UserSourceID string
UserFavoriteID string
ScrapeTaskID string
PostReportID string
ReportType string
ReportState string
)
const (
MaxPageSizeLimit = 100
DefaultPageSize = 50
)
const (
SFW Rating = "safe"
NSFW Rating = "explicit"
Questionable Rating = "questionable"
Unknown Rating = "unknown"
)
const (
General TagType = "general"
Species TagType = "species"
Character TagType = "character"
Artist TagType = "artist"
Lore TagType = "lore"
Meta TagType = "meta"
Invalid TagType = "invalid"
Copyright TagType = "copyright"
Contributor TagType = "Contributor"
UnknownTagType TagType = "Unknown"
)
const (
Duplicate ReportType = "duplicate"
MissingData ReportType = "missing_data"
RatingAbuse ReportType = "rating_abuse"
IllegalContent ReportType = "illegal_content"
)
const (
PendingUnclaimed ReportState = "pending_unclaimed"
Pending ReportState = "pending"
Approved ReportState = "approved"
Partial ReportState = "partial"
Rejected ReportState = "rejected"
)
func (r *Rating) Convert(e621Rating string) {
switch e621Rating {
case "e":
*r = NSFW
case "q":
*r = Questionable
case "s":
*r = SFW
default:
*r = Unknown
}
}