]> Sergey Matveev's repositories - btrtrc.git/blobdiff - cmd/btrtrc/fifos.go
Shortened long filenames
[btrtrc.git] / cmd / btrtrc / fifos.go
index f9aa0117d4d32ba9a8099c09fef6348686f7a100..508f6c097df54708120a39073ec056af6c551eaa 100644 (file)
@@ -18,6 +18,7 @@ import (
        "github.com/anacrolix/dht/v2"
        "github.com/anacrolix/torrent"
        "github.com/anacrolix/torrent/metainfo"
+       "github.com/anacrolix/torrent/storage"
        "github.com/anacrolix/torrent/types/infohash"
        "github.com/dustin/go-humanize"
 )
@@ -304,7 +305,7 @@ func readLinesFromFIFO(pth string) []string {
 }
 
 func saveTorrent(t *torrent.Torrent) error {
-       pth := t.Name() + TorrentExt
+       pth := storage.PathShortener(t.Name()) + TorrentExt
        if _, err := os.Stat(pth); err == nil {
                return nil
        }