Fixed if torrentsEnabled on the other templates.

This commit is contained in:
Travis McCrea 2024-08-20 18:28:28 +07:00
parent dcd71d0bba
commit 363bace4d8
3 changed files with 8 additions and 7 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ annastorrents
torrents.db torrents.db
torrents.db-shm torrents.db-shm
torrents.db-wal torrents.db-wal
assets/torrents

12
main.go
View File

@ -1122,7 +1122,7 @@ func getTemplateContent(name string) string {
<td>{{.StatusLabel}}</td> <td>{{.StatusLabel}}</td>
<td><a href="{{.MagnetLink | urlsafe}}">Magnet</a></td> <td><a href="{{.MagnetLink | urlsafe}}">Magnet</a></td>
<td> <td>
{{if $.Torrents}} {{if torrentsEnabled}}
<a href="/assets/torrents/{{.BTIH}}.torrent">Torrent</a> <a href="/assets/torrents/{{.BTIH}}.torrent">Torrent</a>
{{else}} {{else}}
<a href="{{.URL}}">Torrent</a> <a href="{{.URL}}">Torrent</a>
@ -1148,11 +1148,11 @@ func getTemplateContent(name string) string {
<tr><td>Size</td><td>{{.FormattedDataSize}}</td></tr> <tr><td>Size</td><td>{{.FormattedDataSize}}</td></tr>
<tr><td>Magnet Link</td><td><a href="{{.MagnetLink | urlsafe}}">Magnet</a></td></tr> <tr><td>Magnet Link</td><td><a href="{{.MagnetLink | urlsafe}}">Magnet</a></td></tr>
<tr><td>Torrent Link</td><td> <tr><td>Torrent Link</td><td>
{{if $.Torrents}} {{if torrentsEnabled}}
<a href="/assets/torrents/{{.BTIH}}.torrent">Torrent</a> <a href="/assets/torrents/{{.BTIH}}.torrent">Torrent</a>
{{else}} {{else}}
<a href="{{.URL}}">Torrent</a> <a href="{{.URL}}">Torrent</a>
{{end}} {{end}}
</td></tr> </td></tr>
<tr><td>Last Update</td><td>{{.StatsScrapedAt}}</td></tr> <tr><td>Last Update</td><td>{{.StatsScrapedAt}}</td></tr>
</table> </table>

Binary file not shown.