importfeed: Add feedurl to the metadata
authorJoey Hess <joeyh@joeyh.name>
Thu, 6 Jul 2023 04:10:19 +0000 (00:10 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 6 Jul 2023 04:11:38 +0000 (00:11 -0400)
(And allow it to be used in the --template although that seems unlikely to
be very useful.)

My use case for this is that one of the podcast feeds I subscribe to is
sometimes leaking episodes of some other podcast. The other podcast is also
very close to spam, so this may be a form of intentional spamming. I have
not been able to catch the podcast feed containing those episodes, so I
don't know which one is at fault. So putting this in the metadata will let
me eventually catch it.

CHANGELOG
Command/ImportFeed.hs
doc/git-annex-importfeed.mdwn

index b0ca2f620dac7fdde8bb7cbac725d1db1db7e84c..e34c4dae6bc57efbd6bbb6fdc0e55f17e19d15b6 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -11,6 +11,8 @@ git-annex (10.20230627) UNRELEASED; urgency=medium
   * Bug fix: Re-running git-annex adjust or sync when in an adjusted branch
     would overwrite the original branch, losing any commits that had been
     made to it since the adjusted branch was created.
+  * importfeed: Add feedurl to the metadata (and allow it to be used in the
+    --template)
 
  -- Joey Hess <id@joeyh.name>  Mon, 26 Jun 2023 13:10:40 -0400
 
index e85058048269264260c120a47b1fd23c742d95d2..072f285b0844864b27b2c293aff24286d4b84274 100644 (file)
@@ -537,7 +537,8 @@ minimalMetaData i = case getItemId (item i) of
  - and to generate the filename. -}
 extractFields :: ToDownload -> [(String, String)]
 extractFields i = map (uncurry extractField)
-       [ ("feedtitle", [feedtitle])
+       [ ("feedurl", [Just (feedurl i)])
+       , ("feedtitle", [feedtitle])
        , ("itemtitle", [itemtitle])
        , ("feedauthor", [feedauthor])
        , ("itemauthor", [itemauthor])
index a3a8f5936b2b176bb3bf34e9aba7d9e134099115..1c87288c2461820ff41cd3dbcd3aea7a217867d5 100644 (file)
@@ -72,7 +72,7 @@ resulting in the new url being downloaded to such a filename.
   The default template is '${feedtitle}/${itemtitle}${extension}'
   
   The available variables in the template include these that
-  are information about the feed: feedtitle, feedauthor
+  are information about the feed: feedtitle, feedauthor, feedurl
 
   And these that are information about individual items in the feed:
   itemtitle, itemauthor, itemsummary, itemdescription, itemrights,