Skip to content

Commit

Permalink
Fallback to author name if author id returns no result
Browse files Browse the repository at this point in the history
This will make AppCenter not to find any other application if the
developer has one with a developer ID defined in its metadata!
  • Loading branch information
kerunaru committed Aug 8, 2024
1 parent 54be965 commit ce0e989
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
7 changes: 0 additions & 7 deletions src/Core/FlatpakBackend.vala
Original file line number Diff line number Diff line change
Expand Up @@ -592,13 +592,6 @@ public class AppCenterCore.FlatpakBackend : Object {
continue;
}

if (package.component.get_developer ().get_id () != null) {
warning (package.component.id);
warning (package.component.get_developer ().get_id ());
warning (author_id);
warning ("------------------------------------");
}

if (package.component.get_developer ().get_id () == author_id) {
package_ids.add (package.component.id);

Expand Down
8 changes: 5 additions & 3 deletions src/Views/AuthorView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ private class AppCenter.AuthorView : Gtk.Box {
return;
}

var author_packages = package.author_id == null ?
AppCenterCore.FlatpakBackend.get_default ().get_packages_by_author (package.author, AUTHOR_OTHER_APPS_MAX) :
AppCenterCore.FlatpakBackend.get_default ().get_packages_by_author_id (package.author_id, AUTHOR_OTHER_APPS_MAX);
var author_packages = AppCenterCore.FlatpakBackend.get_default ().get_packages_by_author_id (package.author_id, AUTHOR_OTHER_APPS_MAX);

if (author_packages.size <= 1) {
author_packages = AppCenterCore.FlatpakBackend.get_default ().get_packages_by_author (package.author, AUTHOR_OTHER_APPS_MAX);
}

if (author_packages.size <= 1) {
return;
Expand Down

0 comments on commit ce0e989

Please sign in to comment.