importfeed: Add feedurl to the metadata

(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.
This commit is contained in:
Joey Hess 2023-07-06 00:10:19 -04:00
parent 18faf9fb5b
commit 51b24aac91
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 5 additions and 2 deletions

View file

@ -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 * 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 would overwrite the original branch, losing any commits that had been
made to it since the adjusted branch was created. 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 -- Joey Hess <id@joeyh.name> Mon, 26 Jun 2023 13:10:40 -0400

View file

@ -537,7 +537,8 @@ minimalMetaData i = case getItemId (item i) of
- and to generate the filename. -} - and to generate the filename. -}
extractFields :: ToDownload -> [(String, String)] extractFields :: ToDownload -> [(String, String)]
extractFields i = map (uncurry extractField) extractFields i = map (uncurry extractField)
[ ("feedtitle", [feedtitle]) [ ("feedurl", [Just (feedurl i)])
, ("feedtitle", [feedtitle])
, ("itemtitle", [itemtitle]) , ("itemtitle", [itemtitle])
, ("feedauthor", [feedauthor]) , ("feedauthor", [feedauthor])
, ("itemauthor", [itemauthor]) , ("itemauthor", [itemauthor])

View file

@ -72,7 +72,7 @@ resulting in the new url being downloaded to such a filename.
The default template is '${feedtitle}/${itemtitle}${extension}' The default template is '${feedtitle}/${itemtitle}${extension}'
The available variables in the template include these that 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: And these that are information about individual items in the feed:
itemtitle, itemauthor, itemsummary, itemdescription, itemrights, itemtitle, itemauthor, itemsummary, itemdescription, itemrights,