@@ -610,7 +610,8 @@ def execute_podcast_actions(selected):
610
610
# In the future, we might retrieve the title from gpodder.net here,
611
611
# but for now, we just use "None" to use the feed-provided title
612
612
title = None
613
- add_list = [(title , c .action .url )
613
+ section = None
614
+ add_list = [(title , c .action .url , section )
614
615
for c in selected if c .action .is_add ]
615
616
remove_list = [c .podcast for c in selected if c .action .is_remove ]
616
617
@@ -2561,9 +2562,12 @@ def add_podcast_list(self, podcasts, auth_tokens=None):
2561
2562
# For a given URL, the desired title (or None)
2562
2563
title_for_url = {}
2563
2564
2565
+ # For a given URL, the desired section (or None)
2566
+ section_for_url = {}
2567
+
2564
2568
# Sort and split the URL list into five buckets
2565
2569
queued , failed , existing , worked , authreq = [], [], [], [], []
2566
- for input_title , input_url in podcasts :
2570
+ for input_title , input_url , input_section in podcasts :
2567
2571
url = util .normalize_feed_url (input_url )
2568
2572
2569
2573
# Check if it's a YouTube channel, user, or playlist and resolves it to its feed if that's the case
@@ -2580,6 +2584,7 @@ def add_podcast_list(self, podcasts, auth_tokens=None):
2580
2584
else :
2581
2585
# This URL has survived the first round - queue for add
2582
2586
title_for_url [url ] = input_title
2587
+ section_for_url [url ] = input_section
2583
2588
queued .append (url )
2584
2589
if url != input_url and input_url in auth_tokens :
2585
2590
auth_tokens [url ] = auth_tokens [input_url ]
@@ -2654,7 +2659,7 @@ def on_after_update():
2654
2659
2655
2660
# If we have authentication data to retry, do so here
2656
2661
if retry_podcasts :
2657
- podcasts = [(title_for_url .get (url ), url )
2662
+ podcasts = [(title_for_url .get (url ), url , section_for_url . get ( url ) )
2658
2663
for url in list (retry_podcasts .keys ())]
2659
2664
self .add_podcast_list (podcasts , retry_podcasts )
2660
2665
# This will NOT show new episodes for podcasts that have
@@ -2680,6 +2685,7 @@ def thread_proc():
2680
2685
length = len (queued )
2681
2686
for index , url in enumerate (queued ):
2682
2687
title = title_for_url .get (url )
2688
+ section = section_for_url .get (url )
2683
2689
progress .on_progress (float (index ) / float (length ))
2684
2690
progress .on_message (title or url )
2685
2691
try :
@@ -2696,6 +2702,8 @@ def thread_proc():
2696
2702
if title is not None :
2697
2703
# Prefer title from subscription source (bug 1711)
2698
2704
channel .title = title
2705
+ if section is not None :
2706
+ channel .section = section
2699
2707
2700
2708
if username is not None and channel .auth_username is None and \
2701
2709
password is not None and channel .auth_password is None :
0 commit comments