Skip to content

Commit

Permalink
Reduce screen clutter - only show magnet hash
Browse files Browse the repository at this point in the history
Trying to reduce screen clutter, only show magnet uri up to the hash which is more than enough. 
I'm messy enough as it is.
  • Loading branch information
stl3 authored Dec 25, 2023
1 parent b07fdf9 commit b966144
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/torrodle/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,8 @@ boop~
humanFileSize := humanize.Bytes(uint64(source.FileSize))
fmt.Println(color.CyanString(humanFileSize))
_, _ = boldYellow.Print("Magnet: ")
fmt.Println(source.Magnet)
truncatedMagnet := truncateMagnet(source.Magnet, 60) // Adjust the length as needed
fmt.Println(truncatedMagnet)

// Player
playerChoice := pickPlayer()
Expand All @@ -618,3 +619,10 @@ boop~
// Start playing video...
startClient(p, source, subtitlePath)
}

func truncateMagnet(magnet string, maxLength int) string {
if len(magnet) > maxLength {
return magnet[:maxLength]
}
return magnet
}

0 comments on commit b966144

Please sign in to comment.