mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-06-18 04:39:45 -04:00
support new Liberapay: field, with migration support for LiberapayID:
Liberapay was originally included using a numeric ID, since they had not yet finalized the public URLs. Now it is a username. So this logic prefers the username in Liberapay: field, and uses the old LiberapayID: as a fallback. LiberapayID: will not override Liberapay: if it is already set. This reuses the old database key since it is stored and processed as a String anyway.
This commit is contained in:
@@ -151,7 +151,7 @@ public class IndexV1UpdaterTest extends FDroidProviderTest {
|
||||
Schema.AppMetadataTable.Cols.REPO_ID,
|
||||
Schema.AppMetadataTable.Cols.Package.PACKAGE_NAME});
|
||||
assertEquals("localized icon takes precedence", TESTY_CANONICAL_URL + "/"
|
||||
+ app.packageName + "/en-US/icon.png", app.getIconUrl(context));
|
||||
+ app.packageName + "/en-US/icon.png", app.getIconUrl(context));
|
||||
}
|
||||
|
||||
@Test(expected = IndexUpdater.SigningException.class)
|
||||
@@ -266,6 +266,17 @@ public class IndexV1UpdaterTest extends FDroidProviderTest {
|
||||
}
|
||||
parser.close(); // ensure resources get cleaned up timely and properly
|
||||
|
||||
// test LiberapayID: -> Liberapay: migration
|
||||
for (App app : apps) {
|
||||
if ("org.witness.informacam.app".equals(app.packageName)) {
|
||||
assertEquals("GuardianProject", app.liberapay);
|
||||
} else if ("info.guardianproject.cacert".equals(app.packageName)) {
|
||||
assertEquals("~1337", app.liberapay);
|
||||
} else {
|
||||
assertNull(app.liberapay);
|
||||
}
|
||||
}
|
||||
|
||||
RepoDetails indexV0Details = getFromFile("guardianproject_index.xml",
|
||||
Repo.PUSH_REQUEST_ACCEPT_ALWAYS);
|
||||
indexV0Details.apps.size();
|
||||
@@ -325,7 +336,7 @@ public class IndexV1UpdaterTest extends FDroidProviderTest {
|
||||
"iconUrl",
|
||||
"issueTracker",
|
||||
"lastUpdated",
|
||||
"liberapayID",
|
||||
"liberapay",
|
||||
"license",
|
||||
"litecoin",
|
||||
"name",
|
||||
|
||||
Reference in New Issue
Block a user