Proposing for Lucid:
- The change only affects new podcasts that are downloaded
- Test case:
1. Open Rhythmbox
2. Add http://deimos3.apple.com/WebObjects/Core.woa/Feed/cmu.edu.1335575211.01335575214 as a podcast (Ctrl+P)
3. Download 2 tracks in the podcast
4. Confirm the tracks are different (in the current version they will be the same)
if (local_file_name == NULL) {
- /* fall back to the basename from the original URI */
- local_file_name = g_file_get_basename (data->source);
- rb_debug ("didn't get a filename from the file info request; using basename %s", local_file_name);
+ char *c;
+
+ /* fall back to the escaped URI */
+ local_file_name = g_file_get_uri (data->source);
+ for (c = local_file_name; *c; c++) {
+ if (!isalnum (*c) && *c != '.')
+ *c = '-';
+ }
+ rb_debug ("didn't get a filename from the file info request; using escaped uri %s", local_file_name);
}
/* if the filename ends with the query string from the original URI,
--
Proposing for Lucid: deimos3. apple.com/ WebObjects/ Core.woa/ Feed/cmu. edu.1335575211. 01335575214 as a podcast (Ctrl+P)
- The change only affects new podcasts that are downloaded
- Test case:
1. Open Rhythmbox
2. Add http://
3. Download 2 tracks in the podcast
4. Confirm the tracks are different (in the current version they will be the same)
Patch:
diff --git a/podcast/ rb-podcast- manager. c b/podcast/ rb-podcast- manager. c rb-podcast- manager. c rb-podcast- manager. c
index c220bf2..c23c320 100644
--- a/podcast/
+++ b/podcast/
@@ -29,6 +29,7 @@
#include "config.h"
#include <string.h>
+#include <ctype.h>
#define __USE_XOPEN
#include <time.h>
@@ -790,9 +791,15 @@ download_podcast (GFileInfo *src_info, RBPodcastManage rInfo *data)
}
if (local_file_name == NULL) {
- /* fall back to the basename from the original URI */
- local_file_name = g_file_get_basename (data->source);
- rb_debug ("didn't get a filename from the file info request; using basename %s", local_file_name);
+ char *c;
+
+ /* fall back to the escaped URI */
+ local_file_name = g_file_get_uri (data->source);
+ for (c = local_file_name; *c; c++) {
+ if (!isalnum (*c) && *c != '.')
+ *c = '-';
+ }
+ rb_debug ("didn't get a filename from the file info request; using escaped uri %s", local_file_name);
}
/* if the filename ends with the query string from the original URI,
--