diff --git a/CHANGELOG b/CHANGELOG index 3d4b8e181e..e5202600f8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,7 @@ git-annex (10.20230228) UNRELEASED; urgency=medium * Added arm64 build for ancient kernels, needed to support Android phones whose kernels are too old to support kernels used by the current arm64 build. + * importfeed: Display feed title. -- Joey Hess Mon, 27 Feb 2023 12:31:14 -0400 diff --git a/Command/ImportFeed.hs b/Command/ImportFeed.hs index a2a6284eb3..1a874408a7 100644 --- a/Command/ImportFeed.hs +++ b/Command/ImportFeed.hs @@ -16,6 +16,7 @@ import Text.Feed.Query import Text.Feed.Types import qualified Data.Set as S import qualified Data.Map as M +import Data.Char import Data.Time.Clock import Data.Time.Format import Data.Time.Calendar @@ -93,15 +94,22 @@ getFeed addunlockedmatcher opts cache url = do -- ourselves because it goes out of its way to handle encodings. go tmpf = liftIO (parseFeedFromFile' tmpf) >>= \case Nothing -> debugfeedcontent tmpf "parsing the feed failed" - Just f -> case findDownloads url f of - [] -> debugfeedcontent tmpf "bad feed content; no enclosures to download" - l -> do - showEndOk - ifM (and <$> mapM (performDownload addunlockedmatcher opts cache) l) - ( clearFeedProblem url - , void $ feedProblem url - "problem downloading some item(s) from feed" - ) + Just f -> do + case map sanitizetitle $ decodeBS $ fromFeedText $ getFeedTitle f of + "" -> noop + t -> showNote ('"' : t ++ "\"") + case findDownloads url f of + [] -> debugfeedcontent tmpf "bad feed content; no enclosures to download" + l -> do + showEndOk + ifM (and <$> mapM (performDownload addunlockedmatcher opts cache) l) + ( clearFeedProblem url + , void $ feedProblem url + "problem downloading some item(s) from feed" + ) + sanitizetitle c + | isControl c = '_' + | otherwise = c debugfeedcontent tmpf msg = do feedcontent <- liftIO $ readFile tmpf fastDebug "Command.ImportFeed" $ unlines