stash
stash copied to clipboard
Default view / saved filters for gallery view
In gallery view, I am unable to set a default view. Saved filters don't work, since the gallery-dependance is always included as a filter.
Expected behavior I am able to use filters and "Set as default" just like when viewing scenes. This would probably mean handling gallery view without applying the filter "Galleries include".
Thanks for your efforts, I really enjoy stash Sorry if this is a duplicate. I know, this problem exists for a while now..
IMO, this default view is also needed for page Models >Scenes
I agree, would love to have the option to change default views per menu item!
It would be great to set default global filters for Scenes, Galleries, Images and Movies tabs for all performers.
For now I have been using this custom js to sort the gallery page. you can also change the view type by editing this => ?sortby=rating&sortdir=desc
. Note: you need to have stashUserscriptLibrary installed in order to work.
function getLocalStorage(key) {
return localStorage.getItem(key)
}
function setLocalStorage(key, value) {
localStorage.setItem(key, value)
}
function customSortGalleryPage() {
const sortgalleryLocalStorageKey = "customjs:sortgallery:lastpath"
stash.addEventListener("stash:page", (e) => {
if (!stash.matchUrl(window.location.href, /galleries\/\d+/)) {
setLocalStorage(sortgalleryLocalStorageKey, e.detail?.event)
}
})
stash.addEventListeners(["stash:page:gallery:images", "stash:page:gallery:add"], (e) => {
if (e.detail?.event !== (getLocalStorage(sortgalleryLocalStorageKey) ?? "")) {
setLocalStorage(sortgalleryLocalStorageKey, e.detail?.event)
setTimeout(() => {
window.location.search = "?sortby=rating&sortdir=desc"
}, 100)
}
})
}
;(async () => {
while (!window.stash) {
await new Promise((resolve) => setTimeout(resolve, 100))
}
customSortGalleryPage()
})()
For now I have been using this custom js to sort the gallery page. you can also change the view type by editing this =>
?sortby=rating&sortdir=desc
. Note: you need to have stashUserscriptLibrary installed in order to work.function getLocalStorage(key) { return localStorage.getItem(key) } function setLocalStorage(key, value) { localStorage.setItem(key, value) } function customSortGalleryPage() { const sortgalleryLocalStorageKey = "customjs:sortgallery:lastpath" stash.addEventListener("stash:page", (e) => { if (!stash.matchUrl(window.location.href, /galleries\/\d+/)) { setLocalStorage(sortgalleryLocalStorageKey, e.detail?.event) } }) stash.addEventListeners(["stash:page:gallery:images", "stash:page:gallery:add"], (e) => { if (e.detail?.event !== (getLocalStorage(sortgalleryLocalStorageKey) ?? "")) { setLocalStorage(sortgalleryLocalStorageKey, e.detail?.event) setTimeout(() => { window.location.search = "?sortby=rating&sortdir=desc" }, 100) } }) } ;(async () => { while (!window.stash) { await new Promise((resolve) => setTimeout(resolve, 100)) } customSortGalleryPage() })()
thanks for your solution - I borrowed it and it works very well