Skip to content

Commit

Permalink
Fix article sort reversed (#8532)
Browse files Browse the repository at this point in the history
* Reverse the article sorting implementation.
(The, a, an) sorting was working inverted.

* bundle

* yarn test -u

* yarn dev

Co-authored-by: Dario <medariox@users.noreply.github.com>
  • Loading branch information
p0psicles and medariox authored Sep 25, 2020
1 parent 8f90292 commit 362c303
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default {
const sortedShows = [...showsInLists];
const sortKey = title => (sortArticle ? title.replace(/^((?:the|a|an)\s)/i, '') : title).toLowerCase();
const sortKey = title => (sortArticle ? title : title.replace(/^((?:the|a|an)\s)/i, '')).toLowerCase();
const sortFn = (showA, showB) => {
const titleA = sortKey(showA.title);
const titleB = sortKey(showB.title);
Expand Down
2 changes: 1 addition & 1 deletion themes-default/slim/src/components/show-list/poster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default {
const { stateLayout } = this;
const { sortArticle } = stateLayout;
if (!sortArticle) {
if (sortArticle) {
return row.title;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ exports[`ShowSelector.test.js renders with articles(The|A|An) ignored in /home/d
label="Anime"
>
<option
value="tvdb360438"
value="tvdb300835"
>
A Certain Scientific Accelerator
Ajin
</option>
<option
value="tvdb300835"
value="tvdb360438"
>
Ajin
A Certain Scientific Accelerator
</option>
<option
value="tvdb313867"
Expand Down Expand Up @@ -121,14 +121,14 @@ exports[`ShowSelector.test.js renders with shows in /home/displayShow 1`] = `
label="Anime"
>
<option
value="tvdb300835"
value="tvdb360438"
>
Ajin
A Certain Scientific Accelerator
</option>
<option
value="tvdb360438"
value="tvdb300835"
>
A Certain Scientific Accelerator
Ajin
</option>
<option
value="tvdb313867"
Expand Down Expand Up @@ -182,14 +182,14 @@ exports[`ShowSelector.test.js renders with shows in /home/editShow 1`] = `
label="Anime"
>
<option
value="tvdb300835"
value="tvdb360438"
>
Ajin
A Certain Scientific Accelerator
</option>
<option
value="tvdb360438"
value="tvdb300835"
>
A Certain Scientific Accelerator
Ajin
</option>
<option
value="tvdb313867"
Expand Down Expand Up @@ -243,14 +243,14 @@ exports[`ShowSelector.test.js renders with split sections in /home/displayShow 1
label="Anime"
>
<option
value="tvdb300835"
value="tvdb360438"
>
Ajin
A Certain Scientific Accelerator
</option>
<option
value="tvdb360438"
value="tvdb300835"
>
A Certain Scientific Accelerator
Ajin
</option>
<option
value="tvdb313867"
Expand Down Expand Up @@ -298,14 +298,14 @@ exports[`ShowSelector.test.js renders without placeholder in /home/displayShow 1
label="Anime"
>
<option
value="tvdb300835"
value="tvdb360438"
>
Ajin
A Certain Scientific Accelerator
</option>
<option
value="tvdb360438"
value="tvdb300835"
>
A Certain Scientific Accelerator
Ajin
</option>
<option
value="tvdb313867"
Expand Down
4 changes: 2 additions & 2 deletions themes/dark/assets/js/medusa-runtime.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions themes/light/assets/js/medusa-runtime.js

Large diffs are not rendered by default.

0 comments on commit 362c303

Please sign in to comment.