Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed FeedImage #2726

Merged
merged 9 commits into from
Jun 8, 2018
Merged

Removed FeedImage #2726

merged 9 commits into from
Jun 8, 2018

Conversation

ByteHamster
Copy link
Member

@ByteHamster ByteHamster commented Jun 5, 2018

Please note that due to the database updates, you will not be able to downgrade from this version.

  • Images of FeedItems are added to the database but do not show up
  • Images of subscriptions that need authentication need to be tested

For testing, I have set up a password protected feed: http://www.tools.bytehamster.com/podcast/rss.xml
Username: user, password: password

Closes #2725

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class FeedTest {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, I think we should keep these tests

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class FeedItemTest {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

+ " WHERE " + PodDBAdapter.TABLE_NAME_FEED_IMAGES + "." + PodDBAdapter.KEY_ID
+ " = " + PodDBAdapter.TABLE_NAME_FEEDS + "." + PodDBAdapter.KEY_IMAGE + ")");

db.execSQL("DROP TABLE " + PodDBAdapter.TABLE_NAME_FEED_IMAGES);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we intend to shrink the database file with the upgrade?

Using sqlite3 command line on windows, I noticed the db file is shrinked after DROP TABLE is done, as it VACCUM has been done. But I am unclear if the same behavior applies to Android environment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VACUUM is a quite dangerous operation. Mfietz and I decided that we do not want to execute that currently. In my case, the database shrinked significantly even without VACUUM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to hear - my main concern is the issue should involve a deliberate decision, which is the case here.

Copy link
Contributor

@orionlee orionlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For testing loading images with authentication: it might be another PR, but it'd be better if a test can be included with no external server dependency, e.g., add a test for de.danoeh.antennapod.core.glide.ApOkHttpUrlLoader.BasicAuthenticationInterceptor

The existing HttpDownloaderTest.java uses an embedded HTTP server to avoid external dependency.

+ " INNER JOIN " + TABLE_NAME_FEEDS
+ " ON " + TABLE_NAME_FEED_ITEMS + "." + KEY_FEED + "=" + TABLE_NAME_FEEDS + "." + KEY_ID
+ " WHERE " + TABLE_NAME_FEED_IMAGES + "." + KEY_DOWNLOAD_URL + "=" + downloadUrl;
+ " ON " + TABLE_NAME_FEED_ITEMS + "." + KEY_FEED + " = " + TABLE_NAME_FEEDS + "." + KEY_ID
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regression Image authentication: the logic here supports images of FeedItem, but not the images of Feed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. I used the same icon for feed and item in my tests, so I did not notice.

but it'd be better if a test can be included with no external server dependency

Oh, I did not mean mean my server to be used for unit tests. Just for manual testing ;)

null, "http://example.com/feed", true);
}

}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for restoring. PR #2714 include tests that depend on FeedMother .

@ByteHamster ByteHamster merged commit f015150 into AntennaPod:develop Jun 8, 2018
@ByteHamster
Copy link
Member Author

My main database size decreased from 20 to 15 MB. VACUUM on the exported database decreased the size to 14 MB.

@ByteHamster ByteHamster deleted the feedimage branch March 4, 2019 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants