Tracker API Responses¶
This section shows the raw JSON responses from each tracker platform's API and how the adapter maps those fields to the shared TrackerStats interface. Use it when adding a new tracker or debugging why a field isn't mapping correctly.
Source of truth: src/lib/adapters/
TrackerStats Interface¶
All adapters return TrackerStats defined in src/lib/adapters/types.ts.
interface TrackerStats {
username: string
group: string
uploadedBytes: bigint
downloadedBytes: bigint
ratio: number
bufferBytes: bigint
seedingCount: number
leechingCount: number
seedbonus: number | null
hitAndRuns: number | null
requiredRatio: number | null
warned: boolean | null
freeleechTokens: number | null
remoteUserId?: number
joinedDate?: string
lastAccessDate?: string
shareScore?: number
avatarUrl?: string
platformMeta?: GGnPlatformMeta | GazellePlatformMeta | NebulancePlatformMeta | MamPlatformMeta
}
Fields marked null indicate the tracker doesn't expose that data. We return null explicitly, not undefined or 0.
Platform Reference¶
Adding a New Tracker Platform¶
For a brand new platform (not just a new tracker on an existing one):
- Create
src/lib/adapters/{platform}.tsimplementingTrackerAdapter - Add response interface(s) at the top
- Update
src/lib/adapters/types.tswith newplatformMetafields if needed - Register in
src/lib/adapters/index.ts(getAdapter()factory) - Add platform to the
platformenum insrc/lib/db/schema.ts - Add tracker entries in
src/data/trackers/ - Document the raw response shape here
For a new tracker on an existing platform (i.e., a new UNIT3D site), just add an entry in src/data/trackers/.