]> git.lizzy.rs Git - go-anidb.git/blob - file.go
anidb: (*cacheDir).Get(): reduce the time a file lock is retained
[go-anidb.git] / file.go
1 package anidb
2
3 import (
4         "fmt"
5         "github.com/Kovensky/go-anidb/misc"
6         "image"
7         "time"
8 )
9
10 type FileVersion int
11
12 func (v FileVersion) String() string {
13         if v == 1 {
14                 return ""
15         }
16         return fmt.Sprintf("v%d", int(v))
17 }
18
19 type FileSource string
20
21 type AudioStream struct {
22         Codec    string
23         Bitrate  int
24         Language Language
25 }
26
27 type VideoInfo struct {
28         Codec      string
29         Bitrate    int
30         Resolution image.Rectangle
31         ColorDepth int
32 }
33
34 type File struct {
35         FID FID
36
37         AID AID
38         EID EID
39         GID GID
40
41         Incomplete bool
42
43         Deprecated bool
44         CRCMatch   bool
45         BadCRC     bool
46         Version    FileVersion
47         Uncensored bool // Meaning unclear, may not be simply !Censored
48         Censored   bool // Meaning unclear, may not be simply !Uncensored
49
50         Filesize int64
51         Ed2kHash string
52         SHA1Hash string
53         CRC32    string
54
55         Length  time.Duration
56         AirDate time.Time
57
58         AudioStreams      []AudioStream
59         SubtitleLanguages []Language
60         VideoInfo         VideoInfo
61         FileExtension     string
62
63         Source FileSource
64
65         OtherEpisodes misc.EpisodeList
66
67         Cached time.Time
68 }