Skip to content

Commit

Permalink
Merge pull request #54 from eldertek/nightly
Browse files Browse the repository at this point in the history
Night v1.1.8
  • Loading branch information
eldertek authored Feb 21, 2024
2 parents 852de19 + 4ffb360 commit 54e9ff7
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 44 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.1.8 - 2024-02-21
### Fixed
- Fix [#52](https://github.com/eldertek/duplicatefinder/issues/52)

## 1.1.7 - 2024-02-20
### Fixed
- Refactor the code to use components
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ All settings should be modified only through UI. If this doesn't work for you, y

## Special thanks

Big thanks to @PaulLereverend @chrros95
Big thanks to @PaulLereverend @chrros95 @Routhinator
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<summary lang="fr">Économisez de l’espace en trouvant vos fichiers en doublon</summary>
<description>Are you tired of sifting through piles of files and folders, only to discover multiple copies of the same content cluttering your storage space?</description>
<description lang="fr">Vous en avez assez de passer au crible des piles de fichiers et de dossiers pour découvrir que plusieurs copies du même contenu encombrent votre espace de stockage ?</description>
<version>1.1.7</version>
<version>1.1.8</version>
<licence>agpl</licence>
<author mail="[email protected]" >André Théo LAURET</author>
<namespace>DuplicateFinder</namespace>
Expand Down
2 changes: 1 addition & 1 deletion js/duplicatefinder-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/duplicatefinder-settings.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions lib/Service/FileDuplicateService.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function findAll(
$isLastFetched = false;
$entities = [];

while (empty($entities) && !$isLastFetched) {
while (count($result) < $pageSize && !$isLastFetched) {
$offset = ($page - 1) * $pageSize; // Calculate the offset based on the current page
$entities = $this->mapper->findAll($user, $pageSize, $offset, $orderBy);

Expand All @@ -98,8 +98,8 @@ public function findAll(
}

$isLastFetched = count($entities) < $pageSize; // Determine if this is the last page
if (empty($entities) && !$isLastFetched) {
$page++; // Move to the next page if no entities found and not the last page
if (count($result) < $pageSize && !$isLastFetched) {
$page++; // Move to the next page if no results found and not the last page
}
}

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "duplicatefinder",
"description": "Save some space by finding your duplicate files",
"version": "1.1.7",
"version": "1.1.8",
"author": "André Théo LAURET <[email protected]>",
"contributors": [],
"bugs": {
Expand Down
37 changes: 3 additions & 34 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,42 +41,11 @@ export default {
},
async updateDuplicate(duplicate) {
await this.refreshDuplicates();
await this.moveToNext(duplicate, true);
await this.moveToNext(duplicate);
},
async moveToNext(duplicate, forceNext = false) {
// Determine the current list (acknowledged or unacknowledged) the duplicate belongs to
async moveToNext(duplicate) {
let currentList = duplicate.acknowledged ? this.acknowledgedDuplicates : this.unacknowledgedDuplicates;
let otherList = duplicate.acknowledged ? this.unacknowledgedDuplicates : this.acknowledgedDuplicates;
// Find the index of the current duplicate in its list
let currentIndex = currentList.findIndex(d => d.id === duplicate.id);
// Logic to decide the next duplicate to display
if (currentIndex >= 0) {
// Remove the current duplicate from the list
currentList.splice(currentIndex, 1);
// If there's a next item in the same list, select it
if (currentList.length > currentIndex) {
this.currentDuplicate = currentList[currentIndex];
} else if (currentList.length > 0) {
// If we're at the end of the list, select the last item
this.currentDuplicate = currentList[currentList.length - 1];
} else if (forceNext && otherList.length > 0) {
// If forceNext is true and the other list has items, select the first item from the other list
this.currentDuplicate = otherList[0];
} else {
// If there are no duplicates left to display, clear the current selection
this.currentDuplicate = null;
}
} else if (forceNext && otherList.length > 0) {
// If the duplicate was not found in its expected list and forceNext is true,
// select the first item from the other list
this.currentDuplicate = otherList[0];
} else {
// In any other case, clear the current selection
this.currentDuplicate = null;
}
this.currentDuplicate = currentList[0];
},
async openDuplicate(duplicate) {
this.currentDuplicate = duplicate;
Expand Down

0 comments on commit 54e9ff7

Please sign in to comment.