Skip to content

Commit

Permalink
Gallery: fixed sub page source not sticking + book details library li…
Browse files Browse the repository at this point in the history
…nks leading to the wrong subpage (source)
  • Loading branch information
joonaspaakko committed Aug 20, 2023
1 parent d4e4ca6 commit 6c55a97
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
Binary file modified audible-library-extractor-0.2.9.zip
Binary file not shown.
10 changes: 9 additions & 1 deletion src/gallery/_mixins/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,20 @@ export default {
version: 'v.0.2.9',
highlights: `Full extraction recommended.`,
changes: [
{
description: `Gallery book details: at the top right (above the book title) for switching between links leading to audible or the library`,
class: 'improved',
},
{
description: `Better series merging for discontinued books.`,
class: 'improved',
},
{
description: `Gallery: mobile usage has some minor improvements here and there; the mobile menu is a bit cleaner, you can copy a link to the current page in even if it's saved to your phone's home screen, which is when there's no addressbar or anything to copy it normally.`,
class: 'improved',
},
{
description: `Wallpaper creator: a new tierlist mode.`,
description: `Wallpaper creator: a new "tier list" mode and a clearer preset selector that shows up every time it's opened.`,
class: 'added',
},
{
Expand Down
1 change: 1 addition & 0 deletions src/gallery/_mixins/gallery-findSubPageSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default {

findSubPageSource: function() {
const source = this.$route.query.subPageSource || this.$store.state.sticky.subPageSource;
this.$store.commit('prop', { key: 'sticky.subPageSource', value: source });
const sourceKey = source === 'library' ? 'books' : null;
return {
collection: this.$store.state.library[ sourceKey || source ],
Expand Down
28 changes: 18 additions & 10 deletions src/gallery/_mixins/gallery-makeFullUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ export default {
makeUrl: function(type, input, array) {
const store = this.$store.state;
const base = this.$store.state.urlOrigin;
let newUrl = "";

let newUrl = "";
if ( array && !store.sticky.detailLinksToAudible ) {
const inSubPage = _.get(this.$route, 'meta.subPage');
const routeSubPage = this.$route.name === 'wishlist' ? 'wishlist' : 'library';
const subPageSource = inSubPage ? this.$store.state.sticky.subPageSource : routeSubPage;
switch (type) {
case "store":
case "book":
Expand All @@ -32,10 +35,11 @@ export default {
newUrl = this.$router.resolve({
name: 'author',
params: {
author: input.url
author: input.url || this.slugify(input.name)
},
query: {
// subPageSource: subPageSource.name
subPageSource,
refresh: true,
}
});
break;
Expand All @@ -46,7 +50,8 @@ export default {
narrator: this.slugify(input.name)
},
query: {
// subPageSource: subPageSource.name
subPageSource,
refresh: true,
}
});
break;
Expand All @@ -57,7 +62,8 @@ export default {
series: input.asin
},
query: {
// subPageSource: subPageSource.name
subPageSource,
refresh: true,
}
});
break;
Expand All @@ -68,16 +74,17 @@ export default {
publisher: this.slugify(input.name)
},
query: {
// subPageSource: subPageSource.name
subPageSource,
refresh: true,
}
});
break;
case "tags":
newUrl = this.$router.resolve({
name: 'library',
name: subPageSource,
query: {
filterExtras: `tags:${input.name}`,
// subPageSource: this.subPageSource.name,
refresh: true,
}
});
break;
Expand All @@ -104,7 +111,8 @@ export default {
child: cat.child ? this.slugify(cat.child) : undefined,
},
query: {
// subPageSource: this.subPageSource.name,
subPageSource,
refresh: true,
}
});
break;
Expand All @@ -117,7 +125,7 @@ export default {
newUrl = base + "/pd/" + encodeURIComponent(input);
break;
case "author":
if (input.url) newUrl = base + "/author/" + input.url;
if (input.url) newUrl = base + "/author/" + (input.url || this.slugify(input.name));
else newUrl = base + "/search?searchAuthor=" + encodeURIComponent(input.name);
break;
case "narrator":
Expand Down

0 comments on commit 6c55a97

Please sign in to comment.