podcast-dl 10.0.0 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -82,6 +82,7 @@ Options that support templates allow users to specify a template for the generat
82
82
 
83
83
  - `title`: The title of the episode.
84
84
  - `release_date`: The release date of the episode in `YYYYMMDD` format.
85
+ - `release_year`: The release year of the episode.
85
86
  - `episode_num`: The location number of where the episodes appears in the feed.
86
87
  - `url`: URL of episode audio file.
87
88
  - `duration`: Provided `mm:ss` duration (if found).
package/bin/naming.js CHANGED
@@ -30,7 +30,11 @@ const getItemFilename = ({
30
30
  }) => {
31
31
  const episodeNum = feed.items.length - item._originalIndex + offset;
32
32
  const title = item.title || "";
33
- const formattedPubDate = item.pubDate
33
+ const releaseYear = item.pubDate
34
+ ? dayjs(new Date(item.pubDate)).format("YYYY")
35
+ : null;
36
+
37
+ const releaseDate = item.pubDate
34
38
  ? dayjs(new Date(item.pubDate)).format("YYYYMMDD")
35
39
  : null;
36
40
 
@@ -43,7 +47,8 @@ const getItemFilename = ({
43
47
 
44
48
  const templateReplacementsTuples = [
45
49
  ["title", title],
46
- ["release_date", formattedPubDate || ""],
50
+ ["release_date", releaseDate || ""],
51
+ ["release_year", releaseYear || ""],
47
52
  ["episode_num", `${episodeNum}`.padStart(width, "0")],
48
53
  ["url", url],
49
54
  ["podcast_title", feed.title || ""],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podcast-dl",
3
- "version": "10.0.0",
3
+ "version": "10.1.0",
4
4
  "description": "A CLI for downloading podcasts.",
5
5
  "type": "module",
6
6
  "bin": "./bin/bin.js",