* 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 <id@joeyh.name> Mon, 27 Feb 2023 12:31:14 -0400
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
-- 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