From 56af74242dd76ab6024eac89091ce823bc8ff997 Mon Sep 17 00:00:00 2001 From: MMelchor Date: Wed, 25 Oct 2023 14:53:54 +0200 Subject: [PATCH 1/6] feat: [#278] show torrent fields creation date created by encoding Torrent details page now displays the creation date, created by and encoding fields. --- components/torrent/TorrentCreatedByTab.vue | 46 ++++++++++++++++ components/torrent/TorrentCreationDateTab.vue | 52 +++++++++++++++++++ components/torrent/TorrentDetails.vue | 3 ++ components/torrent/TorrentEncodingTab.vue | 46 ++++++++++++++++ src/helpers/DateConverter.ts | 4 ++ 5 files changed, 151 insertions(+) create mode 100644 components/torrent/TorrentCreatedByTab.vue create mode 100644 components/torrent/TorrentCreationDateTab.vue create mode 100644 components/torrent/TorrentEncodingTab.vue create mode 100644 src/helpers/DateConverter.ts diff --git a/components/torrent/TorrentCreatedByTab.vue b/components/torrent/TorrentCreatedByTab.vue new file mode 100644 index 00000000..d493e650 --- /dev/null +++ b/components/torrent/TorrentCreatedByTab.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/components/torrent/TorrentCreationDateTab.vue b/components/torrent/TorrentCreationDateTab.vue new file mode 100644 index 00000000..f56d26cf --- /dev/null +++ b/components/torrent/TorrentCreationDateTab.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/components/torrent/TorrentDetails.vue b/components/torrent/TorrentDetails.vue index bfd8ca1b..358a2fd6 100644 --- a/components/torrent/TorrentDetails.vue +++ b/components/torrent/TorrentDetails.vue @@ -17,6 +17,9 @@
+ + +
diff --git a/components/torrent/TorrentEncodingTab.vue b/components/torrent/TorrentEncodingTab.vue new file mode 100644 index 00000000..3c9a0275 --- /dev/null +++ b/components/torrent/TorrentEncodingTab.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/src/helpers/DateConverter.ts b/src/helpers/DateConverter.ts new file mode 100644 index 00000000..ee527de4 --- /dev/null +++ b/src/helpers/DateConverter.ts @@ -0,0 +1,4 @@ +export function epochToUtc (date: number) { + const convertedDate = new Date(date * 1000); + return convertedDate.toDateString(); +} From 3f09085b8ecd30c22a96ac5dd6720ff06c0f61be Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 22 Nov 2023 21:05:13 +0100 Subject: [PATCH 2/6] refactor: [#297] Creation date now display as UTC If the torrent creation date field is present in the torrent file, it is now shown as a UTC date in a human readable format. If there is no creation date, a no creation date provided message is displayed. And if there is an error parsing the creation date or if it is a no valid date, an invalid date text is shown. --- components/torrent/TorrentCreationDateTab.vue | 7 +++---- src/helpers/DateConverter.ts | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/components/torrent/TorrentCreationDateTab.vue b/components/torrent/TorrentCreationDateTab.vue index f56d26cf..badcff28 100644 --- a/components/torrent/TorrentCreationDateTab.vue +++ b/components/torrent/TorrentCreationDateTab.vue @@ -15,7 +15,7 @@