fix torrentUrlNum when there is no #n
This commit is contained in:
parent
058956b841
commit
d5cbbe1b9a
1 changed files with 5 additions and 3 deletions
|
@ -149,9 +149,11 @@ torrentUrlWithNum :: URLString -> Int -> URLString
|
|||
torrentUrlWithNum u n = u ++ "#" ++ show n
|
||||
|
||||
torrentUrlNum :: URLString -> (URLString, Int)
|
||||
torrentUrlNum u =
|
||||
let (n, ru) = separate (== '#') (reverse u)
|
||||
in (reverse ru, fromMaybe 1 $ readish $ reverse n)
|
||||
torrentUrlNum u
|
||||
| '#' `elem` u =
|
||||
let (n, ru) = separate (== '#') (reverse u)
|
||||
in (reverse ru, fromMaybe 1 $ readish $ reverse n)
|
||||
| otherwise = (u, 1)
|
||||
|
||||
{- A Key corresponding to the URL of a torrent file. -}
|
||||
torrentUrlKey :: URLString -> Annex Key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue