ribbons / RadioDownloader

An easy to use application for managing podcast subscriptions and downloads.
https://nerdoftheherd.com/tools/radiodld/
GNU General Public License v3.0
15 stars 11 forks source link

Different options per subscription #202

Open Boris-Ockham opened 8 years ago

Boris-Ockham commented 8 years ago

It would be nice if you could optionally have different settings per subscription. In Main Options a combobox could be added with which you could choose a subscription. When a setting is made different then this setting could be added to the settings table with the progid as a postfix.

As a quick fix for my own use I have, for example, in DownloadHandler.cs the following line:

saveLocation = FileUtils.GetSaveFolder(this.progInfo.Progid.ToString());

The definition of GetSaveFolder in FuleUtils.cs is in part:

        public static string GetSaveFolder(string postfix)
        {
            const string DefaultFolder = "Downloaded Radio";

            string saveFolder;
            if (string.IsNullOrEmpty(postfix))
            {
              saveFolder = Settings.SaveFolder;
            }
            else
            {
              saveFolder = Settings.SaveFolderPostfix(postfix);
            }
...
        }

In Settings.cs:

    internal static string SaveFolderPostfix(string postfix)
    {
      string folder = GetValue("SaveFolder" + postfix);
      if (string.IsNullOrEmpty(folder))
      {
        return SaveFolder;
      }
      return folder;
    }
ribbons commented 8 years ago

I like the sound of this, would make the settings much more flexible. Would require some careful thought around the code for moving already downloaded files though.

If you fancy submitting what you have so far as a Pull Request (separate to your database location changes), I can flag up any problematic areas.

Boris-Ockham commented 8 years ago

How do I synchronize https://github.com/Boris-Ockham/RadioDownloader.git with https://github.com/ribbons/RadioDownloader.git?

ribbons commented 8 years ago

How do I synchronize https://github.com/Boris-Ockham/RadioDownloader.git with https://github.com/ribbons/RadioDownloader.git?

Add the upstream repo as a remote: https://help.github.com/articles/configuring-a-remote-for-a-fork/ and then sync yours with it https://help.github.com/articles/syncing-a-fork/

However, as I rebased your commits, you'll probably want to do a git reset --hard upstream/master instead of the merge in step 5 of the sync instructions so that Git doesn't get in a pickle.

Finally, do a git push origin master --force and they should be completely in sync.

Boris-Ockham commented 8 years ago

I want to add a new pull request of the commit "The settings SaveFolder, FileNameFormat and RunAfterCommand can optio…" 31cd23739e8984dc2b89eaf246d39b3b1acc96aa to this issue. But it turns up under #206. It seems that I can't create a new pull request before you have closed #206. I don't doubt that you know what to do. In the meantime I get a headache of this git. :-)

ribbons commented 8 years ago

I want to add a new pull request of the commit "The settings SaveFolder, FileNameFormat and RunAfterCommand can optio…" 31cd237 to this issue. But it turns up under #206. It seems that I can't create a new pull request before you have closed #206. I don't doubt that you know what to do. In the meantime I get a headache of this git. :-)

You need to push commits for different pull requests to different branches. You should be able to remedy the situation along these lines:

Dump the most recent commit from the master branch: git reset --hard HEAD~1

Fix the existing pull request branch on GitHub: git push -f

Get your new commit on a branch on its own:

git checkout -b per-subscription-settings
git reset --hard HEAD~1
git cherry-pick 31cd237
git push --set-upstream origin per-subscription-settings

Depending how good my memory is, you may need to Google around the subject and adjust the above slightly.