Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different options per subscription #202

Open
Boris-Ockham opened this issue Mar 24, 2016 · 5 comments
Open

Different options per subscription #202

Boris-Ockham opened this issue Mar 24, 2016 · 5 comments

Comments

@Boris-Ockham
Copy link
Contributor

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
Copy link
Owner

ribbons commented Mar 25, 2016

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
Copy link
Contributor Author

@ribbons
Copy link
Owner

ribbons commented Mar 26, 2016

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
Copy link
Contributor Author

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. :-)

@ribbons
Copy link
Owner

ribbons commented Apr 16, 2016

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.

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

No branches or pull requests

2 participants