Skip to content

Commit b600541

Browse files
Fixed AtomFeedBuilder test & added Entry getters
1 parent 1723f4e commit b600541

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

src/tests/utils/xml/AtomFeedBuilder.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('AtomFeedBuilder', () => {
1515
expect(xml).toContain('<?xml version="1.0" encoding="utf-8"?>');
1616
expect(xml).toContain('<feed xmlns="http://www.w3.org/2005/Atom"');
1717
expect(xml).toContain('xmlns:opds="http://opds-spec.org/2010/catalog"');
18-
expect(xml).toContain('xmlns:dcterms="http://purl.org/dc/terms/"');
18+
expect(xml).toContain('xmlns:dc="http://purl.org/dc/terms/"');
1919
});
2020

2121
it('should set feed metadata correctly', () => {

src/versions/v1_2/entry.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ export class Entry {
153153
return this;
154154
}
155155

156+
/**
157+
* Gets the summary of the entry.
158+
* @returns The summary text.
159+
*/
160+
getSummary() {
161+
return this.options.summary;
162+
}
163+
156164
/**
157165
* Sets the content of the entry.
158166
* @param content - The content object with type and value.
@@ -163,6 +171,14 @@ export class Entry {
163171
return this;
164172
}
165173

174+
/**
175+
* Gets the content of the entry.
176+
* @returns The content object.
177+
*/
178+
getContent() {
179+
return this.options.content;
180+
}
181+
166182
/**
167183
* Sets the author of the entry.
168184
* @param author - The author's name.
@@ -173,6 +189,14 @@ export class Entry {
173189
return this;
174190
}
175191

192+
/**
193+
* Gets the author information of the entry.
194+
* @returns The author information.
195+
*/
196+
getAuthor() {
197+
return this.options.author;
198+
}
199+
176200
/**
177201
* Sets the updated date of the entry.
178202
* @param updated - The updated date in ISO 8601 format.
@@ -183,6 +207,14 @@ export class Entry {
183207
return this;
184208
}
185209

210+
/**
211+
* Gets the updated date of the entry.
212+
* @returns The updated date.
213+
*/
214+
getUpdated() {
215+
return this.options.updated;
216+
}
217+
186218
/**
187219
* Sets the rights information for the entry.
188220
* @param rights - The rights information.
@@ -193,6 +225,14 @@ export class Entry {
193225
return this;
194226
}
195227

228+
/**
229+
* Gets the rights information of the entry.
230+
* @returns The rights information.
231+
*/
232+
getRights() {
233+
return this.options.rights;
234+
}
235+
196236
/**
197237
* Adds extra metadata to the entry.
198238
* @param key - The key for the extra metadata.

0 commit comments

Comments
 (0)