Skip to content

Implement OPML subscription export#1392

Merged
gzsombor merged 2 commits intoSkyTubeTeam:masterfrom
gzsombor:opml-export
Jan 10, 2026
Merged

Implement OPML subscription export#1392
gzsombor merged 2 commits intoSkyTubeTeam:masterfrom
gzsombor:opml-export

Conversation

@gzsombor
Copy link
Member

No description provided.

@gzsombor gzsombor requested a review from Copilot January 10, 2026 19:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements OPML (Outline Processor Markup Language) export functionality for YouTube subscriptions, allowing users to export their channel subscriptions to a standardized format that can be imported into other RSS readers or applications.

Changes:

  • Added OPML export functionality with support for both Storage Access Framework (Android 4.4+) and legacy file system access
  • Created comprehensive unit tests for OPML generation and XML formatting
  • Updated UI preferences to include OPML export option

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
app/src/test/java/free/rm/skytube/businessobjects/opml/OpmlExporterTest.java Comprehensive test suite covering OPML generation, XML escaping, and edge cases
app/src/main/res/xml/preference_backup.xml Added preference entry for OPML export option in backup settings
app/src/main/res/values/strings_preferences.xml Added localized strings for OPML export UI elements and messages
app/src/main/java/free/rm/skytube/gui/fragments/preferences/BackupPreferenceFragment.java Wired up OPML export preference click handler and removed deprecated onActivityResult
app/src/main/java/free/rm/skytube/gui/fragments/SubscriptionsFeedFragment.java Removed unused Logger import
app/src/main/java/free/rm/skytube/gui/businessobjects/SubscriptionsBackupsManager.java Implemented OPML export with SAF and legacy support, refactored to use ActivityResultLauncher
app/src/main/java/free/rm/skytube/businessobjects/opml/OpmlExporter.java Core OPML export logic with XML generation and escaping utilities
app/src/main/java/free/rm/skytube/businessobjects/db/SubscriptionsDb.java Added public method to retrieve subscribed channels for export

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

public void testGenerateOpmlCorrect() throws ParserConfigurationException, IOException, SAXException {
String opmlContent = OpmlExporter.generateOpmlContent(testChannels);

isOpmlIsValidXml(opmlContent, 3);
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

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

The method name 'isOpmlIsValidXml' contains a redundant 'is' prefix. It should be renamed to 'assertOpmlIsValidXml' or 'validateOpmlXml' to better reflect that it performs validation/assertions rather than returning a boolean.

Copilot uses AI. Check for mistakes.

try (OutputStream outputStream = context.getContentResolver().openOutputStream(outputUri)) {
if (outputStream != null) {
byte[] bytes = opmlContent.getBytes("UTF-8");
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

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

Use StandardCharsets.UTF_8 instead of the string literal "UTF-8" to avoid potential UnsupportedEncodingException and follow modern Java best practices. Change to: opmlContent.getBytes(StandardCharsets.UTF_8)

Copilot uses AI. Check for mistakes.
@gzsombor gzsombor merged commit f79184c into SkyTubeTeam:master Jan 10, 2026
1 check passed
@gzsombor gzsombor deleted the opml-export branch January 10, 2026 21:52
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.

2 participants