Compare commits

...

4 Commits

Author SHA1 Message Date
Balazs Toldi
6d6a79bcb6
Fix python script in the build process 2023-10-24 21:23:23 +02:00
Balazs Toldi
6ff46f928a
Bump version 2023-10-24 20:37:17 +02:00
Balazs Toldi
81e1c73c65
Fix the updating part of the community saving
In a previous commit, I've added a code snippet that made an update query for each fetched summary that is already in the internal database. However, it did not take in to account that the same community can be related to different accounts. This commit fixes this issue by adding an additional filter to the update db query.
2023-10-24 18:58:41 +02:00
Balazs Toldi
554dfff4ad
Always add the access token to the retrofit holder
This hopefully eliminates any login related issues on Lemmy 0.19
2023-10-24 18:51:32 +02:00
4 changed files with 8 additions and 9 deletions

View File

@ -21,8 +21,8 @@ android {
applicationId "eu.toldi.infinityforlemmy"
minSdk 21
targetSdk 33
versionCode 130
versionName "0.1.1"
versionCode 131
versionName "0.1.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
@ -101,7 +101,7 @@ android {
task rearrangeClass(type: Exec) {
commandLine 'python', '../scripts/fixEventBus.py'
commandLine 'python3', '../scripts/fixEventBus.py'
}
applicationVariants.all { variant ->

View File

@ -336,9 +336,8 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
fragmentManager = getSupportFragmentManager();
mAccessToken = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCESS_TOKEN, null);
if (mCurrentAccountSharedPreferences.getBoolean(SharedPreferencesUtils.BEARER_TOKEN_AUTH, true)) {
mRetrofit.setAccessToken(mAccessToken);
}
mRetrofit.setAccessToken(mAccessToken);
mAccountName = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_NAME, null);
mAccountQualifiedName = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_QUALIFIED_NAME, null);

View File

@ -49,7 +49,7 @@ public class InsertSubscribedThings {
for (SubscribedSubredditData s : subscribedSubredditDataList) {
if (existingSubscribedSubredditDataList.contains(s)) {
subscribedSubredditDao.updateSubscribedSubreddit(s.getQualified_name(), s.getName(), s.getIconUrl());
subscribedSubredditDao.updateSubscribedSubreddit(s.getQualified_name(), s.getName(), s.getIconUrl(), accountName);
continue;
}
subscribedSubredditDao.insert(s);

View File

@ -37,6 +37,6 @@ public interface SubscribedSubredditDao {
@Query("SELECT * from subscribed_subreddits WHERE username = :qualified_name AND name LIKE '%' || :searchQuery || '%' COLLATE NOCASE AND is_favorite = 1 ORDER BY name COLLATE NOCASE ASC")
LiveData<List<SubscribedSubredditData>> getAllFavoriteSubscribedSubredditsWithSearchQuery(String qualified_name, String searchQuery);
@Query("UPDATE subscribed_subreddits SET name = :displayName, icon = :icon WHERE qualified_name = :qualified_name")
void updateSubscribedSubreddit(String qualified_name, String displayName, String icon);
@Query("UPDATE subscribed_subreddits SET name = :displayName, icon = :icon WHERE qualified_name = :qualified_name AND username = :accountName COLLATE NOCASE")
void updateSubscribedSubreddit(String qualified_name, String displayName, String icon, String accountName);
}