Skip to content

Commit 8067108

Browse files
committed
Implement review suggestions
1 parent 688c674 commit 8067108

File tree

3 files changed

+2
-32
lines changed

3 files changed

+2
-32
lines changed

app/src/main/java/free/rm/skytube/businessobjects/opml/OpmlParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.io.ByteArrayInputStream;
2424
import java.io.IOException;
2525
import java.io.InputStream;
26-
import java.nio.charset.StandardCharsets;
2726
import java.util.ArrayList;
2827
import java.util.List;
2928
import java.util.regex.Matcher;
@@ -213,6 +212,7 @@ private static String tryExtractChannelId(String url, Pattern primaryPattern, Pa
213212
* @throws XmlPullParserException If there's an error parsing the XML
214213
*/
215214
public static List<ParsedChannel> parseOpml(String opmlString) throws IOException, XmlPullParserException {
215+
// Using "UTF-8" is intentional, so we can keep the same code in SkytubeLegacy too.
216216
try (InputStream inputStream = new ByteArrayInputStream(opmlString.getBytes("UTF-8"))) {
217217
return parseOpml(inputStream);
218218
}

app/src/main/res/values/strings_subs.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<string name="select_all">Select All</string>
2626
<string name="select_none">Select None</string>
2727
<string name="no_channels_found">Could not find any YouTube channels in the file you uploaded.</string>
28-
<string name="no_new_channels_found">We couldn\'t find any YouTube channels that you don\'t already subscribed.</string>
28+
<string name="no_new_channels_found">We couldn\'t find any YouTube channels that you aren\'t already subscribed to.</string>
2929
<string name="import_subscriptions_parse_error">Could not parse the file you uploaded: %s.</string>
3030
<string name="failed_to_import_subscriptions">Could not import your YouTube subscriptions.</string>
3131

app/src/test/java/free/rm/skytube/businessobjects/opml/OpmlParserTest.java

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -165,36 +165,6 @@ void testAllOpmlFilesParseWithoutErrors() throws Exception {
165165
}
166166
}
167167

168-
@Test
169-
void testOpmlFileExtensionDetection() {
170-
// Test that .opml files are correctly identified
171-
String[] opmlFiles = {
172-
"subscriptions.opml",
173-
"export.OPML", // Case insensitive
174-
"backup.opml",
175-
"test.opml.xml" // Should still be detected as OPML first
176-
};
177-
178-
String[] nonOpmlFiles = {
179-
"subscriptions.xml",
180-
"export.json",
181-
"backup.txt",
182-
"subscriptions.opml.backup" // Doesn't end with .opml
183-
};
184-
185-
for (String filename : opmlFiles) {
186-
if (filename.toLowerCase().endsWith(".opml")) {
187-
assertTrue(filename.toLowerCase().endsWith(".opml"),
188-
filename + " should be detected as OPML");
189-
}
190-
}
191-
192-
for (String filename : nonOpmlFiles) {
193-
assertFalse(filename.toLowerCase().endsWith(".opml"),
194-
filename + " should NOT be detected as OPML");
195-
}
196-
}
197-
198168
@Test
199169
void testOpmlStructureConsistency() throws Exception {
200170
// Test that all OPML files have consistent structure

0 commit comments

Comments
 (0)