mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
code format
This commit is contained in:
@@ -7,14 +7,13 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
||||||
// Add a minimal number of mime types to augment go's built in types
|
// Add a minimal number of mime types to augment go's built in types
|
||||||
// for environments which don't have access to a mime.types file (e.g.
|
// for environments which don't have access to a mime.types file (e.g.
|
||||||
// Termux on android)
|
// Termux on android)
|
||||||
for _, t := range []struct {
|
for _, t := range []struct {
|
||||||
mimeType string
|
mimeType string
|
||||||
extensions string
|
extensions string
|
||||||
@@ -101,8 +100,8 @@ func MimeTypeByPath(filePath string) (ret mimeType, err error) {
|
|||||||
if ret == "" {
|
if ret == "" {
|
||||||
ret, err = mimeTypeByContent(filePath)
|
ret, err = mimeTypeByContent(filePath)
|
||||||
}
|
}
|
||||||
// Custom DLNA-compat mime mappings
|
// Custom DLNA-compat mime mappings
|
||||||
// TODO: make this client headers / profile map
|
// TODO: make this client headers / profile map
|
||||||
if ret == "video/mp2t" {
|
if ret == "video/mp2t" {
|
||||||
ret = "video/mpeg"
|
ret = "video/mpeg"
|
||||||
} else if ret == "video/x-matroska" {
|
} else if ret == "video/x-matroska" {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ func Init(path, webpath string) {
|
|||||||
os.Stderr = ff
|
os.Stderr = ff
|
||||||
//https://stackoverflow.com/a/36140590
|
//https://stackoverflow.com/a/36140590
|
||||||
//fmt.Print(time.Now().UTC().Format("2006-01-02T15:04:05.999Z") + " TLOG " + string(bytes))
|
//fmt.Print(time.Now().UTC().Format("2006-01-02T15:04:05.999Z") + " TLOG " + string(bytes))
|
||||||
log.SetFlags(log.Ldate|log.Ltime|log.LUTC|log.Lmsgprefix)
|
log.SetFlags(log.Ldate | log.Ltime | log.LUTC | log.Lmsgprefix)
|
||||||
log.SetPrefix("UTC0 TLOG ")
|
log.SetPrefix("UTC0 TLOG ")
|
||||||
log.SetOutput(ff)
|
log.SetOutput(ff)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ func (t *Torrent) Preload(index int, size int64) {
|
|||||||
|
|
||||||
// mb5 -> 8/16 MB
|
// mb5 -> 8/16 MB
|
||||||
mb5 := int64(t.Info().PieceLength)
|
mb5 := int64(t.Info().PieceLength)
|
||||||
if (mb5 < 8 * 1024 * 1024) {
|
if mb5 < 8*1024*1024 {
|
||||||
mb5 = 8 * 1024 * 1024
|
mb5 = 8 * 1024 * 1024
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user