Permalink
Browse files

Added locking to remaining commands

  • Loading branch information...
1 parent 4d4f43f commit a0d5d2771471736f9170956fbd4b4d2bc5ee2130 @jgoerzen committed May 4, 2007
Showing with 19 additions and 19 deletions.
  1. +1 −1 Commands.hs
  2. +2 −2 Commands/Download.hs
  3. +2 −2 Commands/EnableDisable.hs
  4. +2 −2 Commands/ImportIpodder.hs
  5. +3 −3 Commands/Rm.hs
  6. +2 −2 Commands/SetStatus.hs
  7. +2 −2 Commands/SetTitle.hs
  8. +2 −2 Commands/Setup.hs
  9. +3 −3 Commands/Update.hs
View
@@ -1,5 +1,5 @@
{- hpodder component
-Copyright (C) 2006 John Goerzen <jgoerzen@complete.org>
+Copyright (C) 2006-2007 John Goerzen <jgoerzen@complete.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1,5 +1,5 @@
{- hpodder component
-Copyright (C) 2006 John Goerzen <jgoerzen@complete.org>
+Copyright (C) 2006-2007 John Goerzen <jgoerzen@complete.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -63,7 +63,7 @@ cmd = simpleCmd "download"
"Downloads all pending podcast episodes (run update first)" helptext
[] cmd_worker
-cmd_worker gi ([], casts) =
+cmd_worker gi ([], casts) = lock $
do podcastlist_raw <- getSelectedPodcasts (gdbh gi) casts
let podcastlist = filter_disabled podcastlist_raw
episodelist <- mapM (getEpisodes (gdbh gi)) podcastlist
@@ -1,5 +1,5 @@
{- hpodder component
-Copyright (C) 2006 John Goerzen <jgoerzen@complete.org>
+Copyright (C) 2006-2007 John Goerzen <jgoerzen@complete.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -48,7 +48,7 @@ cmd_worker cmd _ gi ([], []) =
fail $ cmd ++ " requires a podcast ID to remove; please see hpodder "
++ cmd ++ " --help"
-cmd_worker cmd newstat gi ([], casts) =
+cmd_worker cmd newstat gi ([], casts) = lock $
do podcastlist <- getSelectedPodcasts (gdbh gi) casts
evaluate (length podcastlist)
d $ "Setting " ++ (show . length $ podcastlist) ++ " podcasts to " ++
@@ -1,5 +1,5 @@
{- hpodder component
-Copyright (C) 2006 John Goerzen <jgoerzen@complete.org>
+Copyright (C) 2006-2007 John Goerzen <jgoerzen@complete.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -48,7 +48,7 @@ cmd = simpleCmd "import-ipodder"
"Location of ipodder data directory (default ~/.ipodder)"]
cmd_worker
-cmd_worker gi (args, []) =
+cmd_worker gi (args, []) = lock $
do ipodderpath <- case lookup "from" args of
Nothing -> do getAppUserDataDirectory "ipodder"
Just x -> return x
View
@@ -1,5 +1,5 @@
{- hpodder component
-Copyright (C) 2006 John Goerzen <jgoerzen@complete.org>
+Copyright (C) 2006-2007 John Goerzen <jgoerzen@complete.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -39,10 +39,10 @@ cmd = simpleCmd "rm"
"Remove podcast(s) from hpodder" helptext
[] cmd_worker
-cmd_worker gi ([], []) =
+cmd_worker gi ([], []) =
fail $ "rm requires a podcast ID to remove; please see hpodder rm --help"
-cmd_worker gi ([], casts) =
+cmd_worker gi ([], casts) = lock $
do podcastlist <- getSelectedPodcasts (gdbh gi) casts
i "Will remove the following podcasts:\n"
Commands.Ls.lscasts_worker gi ([("l", "")], casts)
@@ -1,5 +1,5 @@
{- hpodder component
-Copyright (C) 2006 John Goerzen <jgoerzen@complete.org>
+Copyright (C) 2006-2007 John Goerzen <jgoerzen@complete.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -51,7 +51,7 @@ cmd = simpleCmd "setstatus"
cmd_worker _ (_, []) =
fail $ "setstatus: episode IDs missing; see hpodder setstatus --help"
-cmd_worker gi (args, episodes) =
+cmd_worker gi (args, episodes) = lock $
do podcastid <- case lookup "castid" args of
Just x -> return (read x)
Nothing -> fail "setstatus: --castid required; see hpodder setstatus --help"
@@ -1,5 +1,5 @@
{- hpodder component
-Copyright (C) 2006 John Goerzen <jgoerzen@complete.org>
+Copyright (C) 2006-2007 John Goerzen <jgoerzen@complete.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,7 +46,7 @@ cmd = simpleCmd "settitle"
"New title for this podcast"]
cmd_worker
-cmd_worker gi (args, []) =
+cmd_worker gi (args, []) = lock $
do podcastid <- case lookup "castid" args of
Just x -> return (read x)
Nothing -> fail "settitle: --castid required; see hpodder settitle --help"
View
@@ -1,5 +1,5 @@
{- hpodder component
-Copyright (C) 2006 John Goerzen <jgoerzen@complete.org>
+Copyright (C) 2006-2007 John Goerzen <jgoerzen@complete.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -47,7 +47,7 @@ cmd = simpleCmd "setup"
"Perform initial configuration of hpodder -- NOT USER-VISIBLE" ""
[] cmd_worker
-cmd_worker gi ([], []) =
+cmd_worker gi ([], []) = lock $
do cp <- loadCP
putStr "Hello! Welcome to hpodder!\n\n\
\It looks like this is your first time running hpodder, so we're going\n\
View
@@ -1,5 +1,5 @@
{- hpodder component
-Copyright (C) 2006 John Goerzen <jgoerzen@complete.org>
+Copyright (C) 2006-2007 John Goerzen <jgoerzen@complete.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -45,7 +45,7 @@ cmd = simpleCmd "update"
"Re-scan all feeds and update list of needed downloads" helptext
[] cmd_worker
-cmd_worker gi ([], casts) =
+cmd_worker gi ([], casts) = lock $
do podcastlist' <- getSelectedPodcasts (gdbh gi) casts
let podcastlist = filter_disabled podcastlist'
i $ printf "%d podcast(s) to consider\n" (length podcastlist)
@@ -124,4 +124,4 @@ helptext = "Usage: hpodder update [castid [castid...]]\n\n" ++ genericIdHelp ++
"\nRunning update will cause hpodder to look at each requested podcast. It\n\
\will download the feed for each one and update its database of available\n\
\episodes. It will not actually download any episodes; see the download\n\
- \command for that."
+ \command for that."

0 comments on commit a0d5d27

Please sign in to comment.