stitch available property, allowing GUI to only stitch when needed
This commit is contained in:
parent
ecfa0aa479
commit
69260d1973
2 changed files with 10 additions and 8 deletions
|
|
@ -76,6 +76,7 @@ class ScanInfo(BaseModel):
|
||||||
created: datetime
|
created: datetime
|
||||||
modified: datetime
|
modified: datetime
|
||||||
number_of_images: int
|
number_of_images: int
|
||||||
|
stitch_available: bool
|
||||||
|
|
||||||
|
|
||||||
DOWNLOADABLE_SCAN_FILES = (
|
DOWNLOADABLE_SCAN_FILES = (
|
||||||
|
|
@ -780,12 +781,17 @@ class SmartScanThing(Thing):
|
||||||
# scans in the GUI or choosing a new scan name, should be ignored
|
# scans in the GUI or choosing a new scan name, should be ignored
|
||||||
|
|
||||||
# A function to delete empty scan folders from the disk achieves all of this
|
# A function to delete empty scan folders from the disk achieves all of this
|
||||||
|
|
||||||
|
stitch_available=(
|
||||||
|
len([i for i in os.listdir(images_folder) if i.endswith("_stitched.jpg")]) > 0
|
||||||
|
)
|
||||||
scans.append(
|
scans.append(
|
||||||
ScanInfo(
|
ScanInfo(
|
||||||
name=f,
|
name=f,
|
||||||
created=os.path.getctime(path),
|
created=os.path.getctime(path),
|
||||||
modified=modified,
|
modified=modified,
|
||||||
number_of_images=number_of_images,
|
number_of_images=number_of_images,
|
||||||
|
stitch_available=stitch_available,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return scans
|
return scans
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,7 @@
|
||||||
class="uk-padding-remove-top"
|
class="uk-padding-remove-top"
|
||||||
uk-lightbox="toggle: .lightbox-link"
|
uk-lightbox="toggle: .lightbox-link"
|
||||||
>
|
>
|
||||||
<!-- Gallery capture cards -->
|
<!-- Gallery capture cards -->
|
||||||
|
|
||||||
<div class="gallery-grid uk-grid-match" uk-grid>
|
<div class="gallery-grid uk-grid-match" uk-grid>
|
||||||
<div v-if="scansEmpty">
|
<div v-if="scansEmpty">
|
||||||
<h2>No scans available</h2>
|
<h2>No scans available</h2>
|
||||||
|
|
@ -90,19 +89,15 @@
|
||||||
:submit-data="{ scan_name: item.name }"
|
:submit-data="{ scan_name: item.name }"
|
||||||
:button-primary="false"
|
:button-primary="false"
|
||||||
:modal-progress="true"
|
:modal-progress="true"
|
||||||
|
v-if="item.can_stitch"
|
||||||
@error="modalError"
|
@error="modalError"
|
||||||
/>
|
/>
|
||||||
<ul>
|
<ul>
|
||||||
<li>{{ item.number_of_images }} images</li>
|
<li>{{ item.number_of_images }} images</li>
|
||||||
<li>created {{ formatDate(item.created) }}</li>
|
<li>created {{ formatDate(item.created) }}</li>
|
||||||
<li>modified {{ formatDate(item.modified) }}</li>
|
<li>modified {{ formatDate(item.modified) }}</li>
|
||||||
|
<li>scan stitched {{ item.stitch_available }}</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div
|
|
||||||
class="uk-text-meta uk-margin-remove-top uk-padding-remove uk-width-expand"
|
|
||||||
>
|
|
||||||
<time>{{ item.created }}</time>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -198,6 +193,7 @@ export default {
|
||||||
scans.forEach(scan => {
|
scans.forEach(scan => {
|
||||||
scan.modified = Date.parse(scan.modified);
|
scan.modified = Date.parse(scan.modified);
|
||||||
scan.created = Date.parse(scan.created);
|
scan.created = Date.parse(scan.created);
|
||||||
|
scan.can_stitch = !scan.stitch_available && scan.number_of_images > 3;
|
||||||
});
|
});
|
||||||
scans.sort((a, b) => {
|
scans.sort((a, b) => {
|
||||||
return b.modified - a.modified;
|
return b.modified - a.modified;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue