server now returns wether the 'unread only' flag was ignored while generating the response (fix scrolling for results in a feed search)

This commit is contained in:
Athou
2014-03-06 15:46:19 +01:00
parent 65d6f8616b
commit 0899e0b0bf
4 changed files with 10 additions and 2 deletions

View File

@@ -41,4 +41,7 @@ public class Entries implements Serializable {
@ApiProperty("list of entries")
private List<Entry> entries = Lists.newArrayList();
@ApiProperty("true if the unread flag was ignored in the request, all entries are returned regardless of their read status")
private boolean ignoredReadStatus;
}

View File

@@ -183,6 +183,7 @@ public class CategoryREST extends AbstractREST {
}
entries.setTimestamp(System.currentTimeMillis());
entries.setIgnoredReadStatus(keywords != null || tag != null);
FeedUtils.removeUnwantedFromSearch(entries.getEntries(), keywords);
return Response.ok(entries).build();
}

View File

@@ -187,6 +187,7 @@ public class FeedREST extends AbstractREST {
}
entries.setTimestamp(System.currentTimeMillis());
entries.setIgnoredReadStatus(keywords != null);
FeedUtils.removeUnwantedFromSearch(entries.getEntries(), keywords);
return Response.ok(entries).build();
}

View File

@@ -696,6 +696,7 @@ module.controller('FeedListCtrl', [
$scope.errorCount = 0;
$scope.timestamp = 0;
$scope.entries = [];
$scope.ignored_read_status = false;
$scope.font_size = 0;
$scope.settingsService = SettingsService;
@@ -729,8 +730,8 @@ module.controller('FeedListCtrl', [
var limit = $scope.limit;
var read_shown = SettingsService.settings.readingMode === 'all' || $scope.selectedType === 'tag'
|| ($scope.selectedType === 'category' && $scope.selectedId === 'starred');
var read_shown = SettingsService.settings.readingMode === 'all' || $scope.ignored_read_status;
console.log("read_shown" + read_shown);
var offset = read_shown ? $scope.entries.length : _.where($scope.entries, {
read : false
}).length;
@@ -761,6 +762,8 @@ module.controller('FeedListCtrl', [
$scope.busy = false;
$scope.hasMore = data.hasMore;
$scope.feedLink = data.feedLink;
$scope.ignored_read_status = data.ignoredReadStatus;
console.log("ignoredReadStatus" + data.ignoredReadStatus);
};
var data = {