aboutsummaryrefslogtreecommitdiffstats
path: root/src/models
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-11 21:01:14 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-08-11 21:01:14 +0530
commit664b2c5a0523439c9672248b652df858facf7ff2 (patch)
treebd6e138cd725166dfef1a93cec7b35118b6b3903 /src/models
parentrevert: fixing #1757 by commenting out partial fix (diff)
downloadferdium-app-664b2c5a0523439c9672248b652df858facf7ff2.tar.gz
ferdium-app-664b2c5a0523439c9672248b652df858facf7ff2.tar.zst
ferdium-app-664b2c5a0523439c9672248b652df858facf7ff2.zip
refactor: removed legacy properties from recipes
(Addendum to getferdi/recipes#605)
Diffstat (limited to 'src/models')
-rw-r--r--src/models/Recipe.js12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/models/Recipe.js b/src/models/Recipe.js
index 92ff0d67d..e616055d6 100644
--- a/src/models/Recipe.js
+++ b/src/models/Recipe.js
@@ -1,9 +1,9 @@
1import emailParser from 'address-rfc2822';
2import semver from 'semver'; 1import semver from 'semver';
3import { pathExistsSync } from 'fs-extra'; 2import { pathExistsSync } from 'fs-extra';
4import { join } from 'path'; 3import { join } from 'path';
5 4
6export default class Recipe { 5export default class Recipe {
6 // Note: Do NOT change these default values. If they change, then the corresponding changes in the recipes needs to be done
7 id = ''; 7 id = '';
8 8
9 name = ''; 9 name = '';
@@ -60,8 +60,6 @@ export default class Recipe {
60 60
61 this.id = data.id || this.id; 61 this.id = data.id || this.id;
62 this.name = data.name || this.name; 62 this.name = data.name || this.name;
63 this.rawAuthor = data.author || this.author;
64 this.description = data.description || this.description;
65 this.version = data.version || this.version; 63 this.version = data.version || this.version;
66 this.path = data.path; 64 this.path = data.path;
67 65
@@ -86,14 +84,8 @@ export default class Recipe {
86 this.message = data.config.message || this.message; 84 this.message = data.config.message || this.message;
87 } 85 }
88 86
87 // TODO: Need to remove this if its not used anywhere
89 get author() { 88 get author() {
90 try {
91 const addresses = emailParser.parse(this.rawAuthor);
92 return addresses.map((a) => ({ email: a.address, name: a.phrase }));
93 } catch (err) {
94 console.warn(`Not a valid author for ${this.name}`);
95 }
96
97 return []; 89 return [];
98 } 90 }
99 91