mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
update
This commit is contained in:
@@ -40,6 +40,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
sort.Strings(files)
|
||||||
fmap := writeEmbed(srcGo+"template/html.go", files)
|
fmap := writeEmbed(srcGo+"template/html.go", files)
|
||||||
writeRoute(srcGo+"template/route.go", fmap)
|
writeRoute(srcGo+"template/route.go", fmap)
|
||||||
}
|
}
|
||||||
@@ -97,6 +98,12 @@ func RouteWebPages(route *gin.RouterGroup) {
|
|||||||
sort.Strings(keys)
|
sort.Strings(keys)
|
||||||
for _, link := range keys {
|
for _, link := range keys {
|
||||||
fmime := mime.TypeByExtension(filepath.Ext(link))
|
fmime := mime.TypeByExtension(filepath.Ext(link))
|
||||||
|
if fmime == "application/xml" || fmime == "application/javascript" {
|
||||||
|
fmime = fmime + "; charset=utf-8"
|
||||||
|
}
|
||||||
|
if fmime == "image/x-icon" {
|
||||||
|
fmime = "image/vnd.microsoft.icon"
|
||||||
|
}
|
||||||
embedStr += `
|
embedStr += `
|
||||||
route.GET("` + link + `", func(c *gin.Context) {
|
route.GET("` + link + `", func(c *gin.Context) {
|
||||||
c.Data(200, "` + fmime + `", ` + fmap[link] + `)
|
c.Data(200, "` + fmime + `", ` + fmap[link] + `)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package torr
|
package torr
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"server/settings"
|
"server/settings"
|
||||||
@@ -9,11 +10,25 @@ import (
|
|||||||
"github.com/anacrolix/torrent/metainfo"
|
"github.com/anacrolix/torrent/metainfo"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type tsFiles struct {
|
||||||
|
TorrServer struct {
|
||||||
|
Files []*state.TorrentFileStat `json:"Files"`
|
||||||
|
} `json:"TorrServer"`
|
||||||
|
}
|
||||||
|
|
||||||
func AddTorrentDB(torr *Torrent) {
|
func AddTorrentDB(torr *Torrent) {
|
||||||
t := new(settings.TorrentDB)
|
t := new(settings.TorrentDB)
|
||||||
t.TorrentSpec = torr.TorrentSpec
|
t.TorrentSpec = torr.TorrentSpec
|
||||||
t.Title = torr.Title
|
t.Title = torr.Title
|
||||||
t.Data = torr.Data
|
if torr.Data == "" {
|
||||||
|
files := new(tsFiles)
|
||||||
|
files.TorrServer.Files = torr.Status().FileStats
|
||||||
|
buf, _ := json.Marshal(files)
|
||||||
|
t.Data = string(buf)
|
||||||
|
torr.Data = t.Data
|
||||||
|
} else {
|
||||||
|
t.Data = torr.Data
|
||||||
|
}
|
||||||
t.Poster = torr.Poster
|
t.Poster = torr.Poster
|
||||||
t.Size = torr.Size
|
t.Size = torr.Size
|
||||||
if t.Size == 0 && torr.Torrent != nil {
|
if t.Size == 0 && torr.Torrent != nil {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ func SetupRoute(route *gin.RouterGroup) {
|
|||||||
route.GET("/msx/torrents", msxTorrents)
|
route.GET("/msx/torrents", msxTorrents)
|
||||||
route.GET("/msx/playlist", msxPlaylist)
|
route.GET("/msx/playlist", msxPlaylist)
|
||||||
route.GET("/msx/playlist/*fname", msxPlaylist)
|
route.GET("/msx/playlist/*fname", msxPlaylist)
|
||||||
|
|
||||||
route.GET("/msx/tizen.html", func(c *gin.Context) {
|
route.GET("/msx/tizen.html", func(c *gin.Context) {
|
||||||
c.Data(200, "text/html; charset=utf-8", Msxtizenhtml)
|
c.Data(200, "text/html; charset=utf-8", Msxtizenhtml)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export default function DonateDialog({ onClose }) {
|
|||||||
<ButtonGroup variant='outlined' color='primary' aria-label='contained primary button group'>
|
<ButtonGroup variant='outlined' color='primary' aria-label='contained primary button group'>
|
||||||
<Button onClick={() => window.open('https://www.paypal.com/paypalme/yourok', '_blank')}>PayPal</Button>
|
<Button onClick={() => window.open('https://www.paypal.com/paypalme/yourok', '_blank')}>PayPal</Button>
|
||||||
<Button onClick={() => window.open('https://yoomoney.ru/to/410013733697114', '_blank')}>IO.Money</Button>
|
<Button onClick={() => window.open('https://yoomoney.ru/to/410013733697114', '_blank')}>IO.Money</Button>
|
||||||
|
<Button onClick={() => window.open('https://qiwi.com/n/YOUROK85', '_blank')}>QIWI</Button>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem key='DonateForm'>
|
<ListItem key='DonateForm'>
|
||||||
@@ -31,7 +32,6 @@ export default function DonateDialog({ onClose }) {
|
|||||||
</ListItem>
|
</ListItem>
|
||||||
</List>
|
</List>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={onClose} color='secondary' variant='contained'>
|
<Button onClick={onClose} color='secondary' variant='contained'>
|
||||||
Ok
|
Ok
|
||||||
|
|||||||
Reference in New Issue
Block a user