diff options
Diffstat (limited to 'src/data/things')
-rw-r--r-- | src/data/things/album.js | 7 | ||||
-rw-r--r-- | src/data/things/art-tag.js | 6 | ||||
-rw-r--r-- | src/data/things/flash.js | 5 | ||||
-rw-r--r-- | src/data/things/news-entry.js | 7 | ||||
-rw-r--r-- | src/data/things/static-page.js | 6 |
5 files changed, 21 insertions, 10 deletions
diff --git a/src/data/things/album.js b/src/data/things/album.js index 9d4729e4..318979cc 100644 --- a/src/data/things/album.js +++ b/src/data/things/album.js @@ -8,6 +8,8 @@ import {traverse} from '#node-utils'; import {empty} from '#sugar'; import Thing from '#thing'; import {isDate} from '#validators'; +import {sortAlbumsTracksChronologically, sortChronologically} + from '#wiki-data'; import {parseAdditionalFiles, parseContributors, parseDate, parseDimensions} from '#yaml'; @@ -369,6 +371,11 @@ export class Album extends Thing { return {albumData, trackData}; }, + + sort({albumData, trackData}) { + sortChronologically(albumData); + sortAlbumsTracksChronologically(trackData); + }, }); } diff --git a/src/data/things/art-tag.js b/src/data/things/art-tag.js index 29cd2990..4d423db5 100644 --- a/src/data/things/art-tag.js +++ b/src/data/things/art-tag.js @@ -86,10 +86,10 @@ export class ArtTag extends Thing { documentMode: allInOne, documentThing: ArtTag, - save(artTagData) { - sortAlphabetically(artTagData); + save: (results) => ({artTagData: results}), - return {artTagData}; + sort({artTagData}) { + sortAlphabetically(artTagData); }, }); } diff --git a/src/data/things/flash.js b/src/data/things/flash.js index ad80cbf2..93653548 100644 --- a/src/data/things/flash.js +++ b/src/data/things/flash.js @@ -4,6 +4,7 @@ import {input} from '#composite'; import find from '#find'; import Thing from '#thing'; import {anyOf, isColor, isDirectory, isNumber, isString} from '#validators'; +import {sortFlashesChronologically} from '#wiki-data'; import {parseDate, parseContributors} from '#yaml'; import {exposeDependency, exposeUpdateValueOrContinue} @@ -250,5 +251,9 @@ export class FlashAct extends Thing { return {flashData, flashActData}; }, + + sort({flashData}) { + sortFlashesChronologically(flashData); + }, }); } diff --git a/src/data/things/news-entry.js b/src/data/things/news-entry.js index 658453b0..e0ec7f7b 100644 --- a/src/data/things/news-entry.js +++ b/src/data/things/news-entry.js @@ -57,11 +57,10 @@ export class NewsEntry extends Thing { documentMode: allInOne, documentThing: NewsEntry, - save(newsData) { - sortChronologically(newsData); - newsData.reverse(); + save: (results) => ({newsData: results}), - return {newsData}; + sort({newsData}) { + sortChronologically(newsData, {latestFirst: true}); }, }); } diff --git a/src/data/things/static-page.js b/src/data/things/static-page.js index 1e8cb7c6..9c7fec65 100644 --- a/src/data/things/static-page.js +++ b/src/data/things/static-page.js @@ -64,10 +64,10 @@ export class StaticPage extends Thing { documentMode: onePerFile, documentThing: StaticPage, - save(staticPageData) { - sortAlphabetically(staticPageData); + save: (results) => ({staticPageData: results}), - return {staticPageData}; + sort({staticPageData}) { + sortAlphabetically(staticPageData); }, }); } |