|
68 | 68 | {{format(parseISO(item.release_date), "yyyy-MM-dd")}}
|
69 | 69 | </span>
|
70 | 70 | </span>
|
71 |
| - <divclass="image-row"v-if="getAlternateSceneSources != 0"> |
72 |
| - <divv-for="(altsrc, idx) inalternateSourcesWithTitles":key="idx"class="altsrc-image-wrapper"> |
| 71 | + <divclass="image-row"v-if="getAlternateSceneSourcesWithTitles != 0"> |
| 72 | + <divv-for="(altsrc, idx) inthis.alternateSources":key="idx"class="altsrc-image-wrapper"> |
73 | 73 | <b-tooltiptype="is-light":label="altsrc.title":delay="100">
|
74 | 74 | <a:href="altsrc.url"target="_blank">
|
75 | 75 | <vue-load-image>
|
@@ -155,31 +155,34 @@ export default {
|
155 | 155 | }
|
156 | 156 | returnthis.$store.state.optionsWeb.web.isAvailOpacity/100
|
157 | 157 | },
|
158 |
| -asyncgetAlternateSceneSources() { |
159 |
| -try { |
| 158 | +asyncgetAlternateSceneSourcesWithTitles() { |
| 159 | +try { |
160 | 160 | constresponse=awaitky.get('/api/scene/alternate_source/'+this.item.id).json();
|
161 | 161 | this.alternateSources= [];
|
162 |
| -if (response==null){ |
163 |
| -return0 |
| 162 | +if (response==null){ |
| 163 | +return0; |
164 | 164 | }
|
165 |
| -response.forEach(altsrc=> { |
166 |
| -if (altsrc.external_source.startsWith("alternate scene")||altsrc.external_source=="stashdb scene") { |
167 |
| -this.alternateSources.push(altsrc) |
168 |
| - } |
169 |
| - }); |
| 165 | +
|
| 166 | +this.alternateSources= response |
| 167 | + .filter(altsrc=>altsrc.external_source.startsWith("alternate scene")||altsrc.external_source=="stashdb scene") |
| 168 | + .map(altsrc=> { |
| 169 | +constextdata=JSON.parse(altsrc.external_data); |
| 170 | +let title; |
| 171 | +if (altsrc.external_source.startsWith("alternate scene")) { |
| 172 | + title=extdata.scene?.title||'No Title'; |
| 173 | + }elseif (altsrc.external_source=="stashdb scene") { |
| 174 | + title=extdata.title||'No Title'; |
| 175 | + } |
| 176 | +return { |
| 177 | +...altsrc, |
| 178 | + title: title |
| 179 | + }; |
| 180 | + }); |
| 181 | +
|
170 | 182 | returnthis.alternateSources.length;
|
171 |
| - }catch (error) { |
| 183 | + }catch (error) { |
172 | 184 | return0;// Return 0 or handle error as needed
|
173 | 185 | }
|
174 |
| - }, |
175 |
| -alternateSourcesWithTitles() { |
176 |
| -returnthis.alternateSources.map(altsrc=> { |
177 |
| -constextdata=JSON.parse(altsrc.external_data); |
178 |
| -return { |
179 |
| -...altsrc, |
180 |
| - title:extdata.scene?.title||'No Title' |
181 |
| - }; |
182 |
| - }); |
183 | 186 | }
|
184 | 187 | },
|
185 | 188 | methods: {
|
|