README
¶
Serato Parser
A GoLang library for reading Serato database files.
Data Types Supported:
- Database V2
- Crates
- History Database
- History Sessions
Installation
This package can be installed with the go get command:
go get -u github.com/SpinTools/seratoparser
Usage
func main() {
// Provide Serato Folder
p := seratoparser.New("/Users/Stoyvo/Music/_Serato_")
// Get All Tracks in Serato Database
Tracks := p.GetAllTracks()
log.Println("Database V2:", Tracks)
// Get all Crates
crates := p.GetCrates()
log.Println("Crates:", crates)
// Read crate and get all Tracks
mediaEntities := p.GetCrateTracks(crates[0].Name())
log.Println("Crate Tracks:", mediaEntities)
// Get all session files
sessions := p.GetHistorySessions()
log.Println("History Sessions:", sessions)
// Read History Session
historyEntities := p.ReadHistorySession(sessions[0].Name())
log.Println("History Tracks:", historyEntities)
}
Contributing
Pull requests are welcome, update tests as appropriate.
License
Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var HistoryPath = "/History"
HistoryPath is the path inside the _Serato_ folder that contains History data
var SeratoAdatMap = map[int]string{
1: "RROW",
2: "RDIR",
28: "TTMS",
29: "TTME",
31: "TDCK",
41: "RDTE",
43: "RSRT",
44: "REND",
45: "TPTM",
48: "RSES",
50: "RPLY",
52: "RADD",
53: "RUPD",
54: "RUNK",
57: "RSWR",
58: "RSWB",
63: "RDEV",
}
SeratoAdatMap Defines all the known keys with their integer key found in Serato Databases TODO: Identify all fields of an ADAT object
var SessionPath = HistoryPath + "/Sessions"
SessionPath is the path inside the _Serato_/History folder that contains all the played Sessions.
Functions ¶
This section is empty.
Types ¶
type HistoryEntity ¶
type HistoryEntity struct { RROW int // rrow RDIR string // rfullpath TTMS int // rstarttime TTME int // rendtime TDCK int // rdeck RDTE string // rdate* RSRT int // rstart* REND int // rend* TPTM int // rplaytime RSES int // rsessionId RPLY int // rplayed = 1 RADD int // radded RUPD int // rupdatedAt RSWR string // rsoftware* RSWB int // rsoftwareBuild* RDEV string // rdevice }
HistoryEntity defines Tracks/Songs entities in a History Session
type MediaEntity ¶
type MediaEntity struct { // META DVOL string // volume // UTFSTR PTRK string // filetrack PFIL string // filebase // INT1 BMIS bool // missing BCRT bool // corrupt // INT4 UADD int // timeadded // BYTE SLICE ULBL []byte // color - track colour }
MediaEntity defines Tracks/Songs entities in a Database or Crate
type Parser ¶
type Parser struct {
FilePath string
}
Parser holds the filepath of all databases
var SeratoParser Parser
SeratoParser is the Parser for this Serato Database module. Exported for future option of override
func (Parser) GetAllTracks ¶
func (p Parser) GetAllTracks() []MediaEntity
GetAllTracks returns all the tracks/entities inside the Database
func (Parser) GetCrateTracks ¶
func (p Parser) GetCrateTracks(fileName string) []MediaEntity
GetCrateTracks takes a filename and returns all the tracks/entities inside the crate
func (Parser) GetCrates ¶
GetCrates returns files of all crates found in Serato Path TODO: Should we parse meta data of theses files, or only provide OS level elements. Weird to be a parser library and no parsing. TODO: Is there Serato Crate meta data?
func (Parser) GetHistorySessions ¶
GetHistorySessions returns a list of all Serato History session files in the users Serato directory.
func (Parser) ReadHistorySession ¶
func (p Parser) ReadHistorySession(fileName string) []HistoryEntity
ReadHistorySession returns all track entities within the provided filepath.