From 9140b58c7022f5250fa7c35db0d68e0be266991f Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Wed, 11 Sep 2024 05:16:58 +0200 Subject: [PATCH] Removed post.user variable. --- README.md | 1 - config/default.js | 22 +++++++++++----------- src/interpolate.js | 1 - src/methods/self.js | 16 +++++++--------- 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 389e52a..ff5f7df 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,6 @@ Path patterns dictate where and how a file will be saved. Various variables and ##### Post * `{post.id}`: The ID of the reddit post * `{post.title}`: The title of the reddit post -* `{post.user}`: The user that submitted the post, almost always equivalent to the `--user` command line argument * `{post.date}`: The submission date of the reddit post, formatted by the `dateFormat` configuration described below * `{post.index}`: The index of the post according to the sort method * `{post.score}`: The current karma score of the post diff --git a/config/default.js b/config/default.js index bf0cf9f..4b9d01c 100644 --- a/config/default.js +++ b/config/default.js @@ -7,27 +7,27 @@ module.exports = { direct: 'output/{host.name}/{label}/', }, posts: { - image: '{base.posts}{post.date}{div}{tag.preview}{item.id}{div}{post.title}{ext}', - video: '{base.posts}{post.date}{div}{tag.preview}{item.id}{div}{post.title}{ext}', - text: '{base.posts}{post.date}{div}{tag.preview}{post.id}{div}{post.title}', + image: '{base.posts}{post.date}{div}{tags.preview}{item.id}{div}{post.title}{ext}', + video: '{base.posts}{post.date}{div}{tags.preview}{item.id}{div}{post.title}{ext}', + text: '{base.posts}{post.date}{div}{tags.preview}{post.id}{div}{post.title}', album: { - image: '{base.posts}{post.date}{div}{tag.preview}{album.id}{div}{post.title}/{item.index}{div}{item.id}{ext}', - video: '{base.posts}{post.date}{div}{tag.preview}{album.id}{div}{post.title}/{item.index}{div}{item.id}{ext}', + image: '{base.posts}{post.date}{div}{tags.preview}{album.id}{div}{post.title}/{item.index}{div}{item.id}{ext}', + video: '{base.posts}{post.date}{div}{tags.preview}{album.id}{div}{post.title}/{item.index}{div}{item.id}{ext}', }, }, direct: { - image: '{base.direct}{item.date}{div}{tag.preview}{item.id}{divs.item.title}{item.title}{ext}', - video: '{base.direct}{item.date}{div}{tag.preview}{item.id}{divs.item.title}{item.title}{ext}', - text: '{base.direct}{item.date}{div}{tag.preview}{item.id}{divs.item.title}{item.title}', + image: '{base.direct}{item.date}{div}{tags.preview}{item.id}{divs.item.title}{item.title}{ext}', + video: '{base.direct}{item.date}{div}{tags.preview}{item.id}{divs.item.title}{item.title}{ext}', + text: '{base.direct}{item.date}{div}{tags.preview}{item.id}{divs.item.title}{item.title}', album: { - image: '{base.direct}{album.date}{div}{tag.preview}{album.id}{divs.album.title}{album.title}/{item.index}{div}{item.id}{ext}', - video: '{base.direct}{album.date}{div}{tag.preview}{album.id}{divs.album.title}{album.title}/{item.index}{div}{item.id}{ext}', + image: '{base.direct}{album.date}{div}{tags.preview}{album.id}{divs.album.title}{album.title}/{item.index}{div}{item.id}{ext}', + video: '{base.direct}{album.date}{div}{tags.preview}{album.id}{divs.album.title}{album.title}/{item.index}{div}{item.id}{ext}', }, }, extractSingleAlbumItem: true, profile: { image: '{base.posts}{user.created}{div}profile{ext}', - description: '{base.posts}{user.created}{div}profile ({tag.verified}{tag.verifiedEmail}{tag.gold}{tag.over18})', + description: '{base.posts}{user.created}{div}profile ({tags.verified}{tags.verifiedEmail}{tags.gold}{tags.over18})', avoidAvatar: true, }, index: { diff --git a/src/interpolate.js b/src/interpolate.js index 830b48e..b4e8ae1 100644 --- a/src/interpolate.js +++ b/src/interpolate.js @@ -60,7 +60,6 @@ function interpolate(pattern, item = null, content = null, host = null, post = n id: post.id, title: post.title && post.title.slice(0, config.library.titleLength), url: post.url, - user: post.user, date: dateFns.format(post.datetime, dateFormat), index: post.index + config.library.indexOffset, hash: post.hash, diff --git a/src/methods/self.js b/src/methods/self.js index 062454b..3024fb8 100644 --- a/src/methods/self.js +++ b/src/methods/self.js @@ -1,11 +1,9 @@ - 'use strict'; +'use strict'; -const util = require('util'); -const config = require('config'); -const fetch = require('node-fetch'); +function self(host, post) { + console.log(post); -function self(post) { - return Promise.resolve({ + return { album: null, items: [{ id: post.id, @@ -15,9 +13,9 @@ function self(post) { datetime: post.datetime, type: 'text/plain', self: true, - original: post + original: post, }] - }); -}; + }; +} module.exports = self;