PortableApps.com Carbide driveThe PortableApps.com Carbide is here! The Safest, Most Secure USB Flash Drive on Earth.
Military-grade hardware-encryption, water/shock/dust/tamper-resistant, 5 years of commercial USB antivirus, 5 year warranty, personalized, and PortableApps.com! 8GB, 16GB and 32GB starting at $89.95! Learn more and buy today!
Also: PA.c Companion (fast, affordable, colorful) | Please donate, so we can update & release new awesome apps!

[Fixed] gPodder settings reset

nascent's picture
nascent (Homepage) - May 3, 2012 - 8:49am

I used to be able to change the settings of gPodder, but now If I change the download path and close gpodder, upon reopen the download path is reset. I understand the reason for the default path. But surely removing the ability to set a path isn't desired? If a user wishes to point the path to a different drive/path then this shouldn't be ignored upon restart?


( categories: )

Download Path

The download path has always been fixed. This is due to a bug within gPodder itself.

Sometimes, the impossible can become possible, if you're awesome!

Damn. I've not noticed the

Damn. I've not noticed the issue before. My usb drive has been filling up by podcasts only recently. normally i have it downlaode to a different drive.

Is there no fix or hack I can do?

My Hack

WARNING: USE AT YOUR OWN RISK

For Version gPodder 3.1.0

Change Files
    1. gPodderPortable\App\AppInfo\Launcher\gPodderPortable.ini
        [Environment]
        GPODDER_DOWNLOAD_DIR=(Your directory that you wish to download podcast too)
        
    2. gPodderPortable\App\gPodder\src\gpodder\__init__.py
        Replace Code Block:

            # Function to set a new gPodder home folder
            def set_home(new_home):
                global home, config_file, database_file, downloads
                home = os.path.abspath(new_home)

                config_file = os.path.join(home, 'Settings.json')
                database_file = os.path.join(home, 'Database')
                downloads = os.path.join(home, 'Downloads')

            # Default locations for configuration and data files
            default_home = os.path.expanduser(os.path.join('~', 'gPodder'))
            set_home(os.environ.get('GPODDER_HOME', default_home))

         With:
            
            # Default locations for configuration and data files
            default_home = os.path.expanduser(os.path.join('~', 'gPodder'))

            if os.path.exists(os.environ.get('GPODDER_HOME')) and os.path.isdir(os.environ.get('GPODDER_HOME')):
                home = os.path.abspath(os.environ.get('GPODDER_HOME'));
            else:
                home = os.path.abspath(default_home)

            config_file = os.path.join(home, 'Settings.json')
            database_file = os.path.join(home, 'Database')

            # Sets download location
            if os.path.exists(os.environ.get('GPODDER_DOWNLOAD_DIR')) and os.path.isdir(os.environ.get('GPODDER_DOWNLOAD_DIR')):
                downloads = os.path.abspath(os.environ.get('GPODDER_DOWNLOAD_DIR'))
            else:
                downloads = os.path.join(home, 'Downloads')

Many thanks for the tip. I

Many thanks for the tip. I did change #1, although I see no src directory for change #2. I assume that's only to recompile it. Is the first change alone not enough to do as desired?

Environmental variable

Environmental variable GPODDER_DOWNLOAD_DIR does not exists 
in gPodder 3.1.x. It did in gPodder 2.x but, It did not work 
correctly. My fix adds the environmental variable 
GPODDER_DOWNLOAD_DIR and only works for gPodder 3.1.x. No 
Recompiling Necessary. If you don't see the src folder, you 
don't have version gPodder 3.1.x

Switch Up

Could you rework your patch so we can just add a couple lines to the end. Basically, just a simple check for the env var and then replace the current downloads var. That way if they alter the code, our patch will still be the same (adding a few lines right after theirs).

Sometimes, the impossible can become possible, if you're awesome!

Your solution will work

Your solution will work something like this
    # Sets download location
    if os.environ.get('GPODDER_DOWNLOAD_DIR', None) is not None:
        if os.path.exists(os.environ.get('GPODDER_DOWNLOAD_DIR')) and os.path.isdir(os.environ.get('GPODDER_DOWNLOAD_DIR')):
            downloads = os.path.abspath(os.environ.get('GPODDER_DOWNLOAD_DIR'))

right after this

    # Default locations for configuration and data files
    default_home = os.path.expanduser(os.path.join('~', 'gPodder'))
    set_home(os.environ.get('GPODDER_HOME', default_home))

I think I figured out why

I think I must've had a symlink to point to the desired location. and during my windows reinstall forgot to set up the symlink. It'd still be nice to have a better way of doing it via setting though, s when taking it round on usb, symlinks arent a possibility.

Forked

For those who are interested i have forked gPodder, https://github.com/J-P-77/gpodder and have applied my patch

That's awesome. Thank you

That's awesome. Thank you very much!

New Download Setting Added in 3.1.2

I've added a new advanced download setting to gPodder Portable 3.1.2. In the gPodderPortable.ini file there are 3 new options. They are explained in the new example INI included in Other\Source, which I have also included here:

[gPodderPortable]
AdditionalParameters=
DisableSplashScreen=false
RunLocally=false

# The above options are explained in the included readme.txt
# This INI file is an example only and is not used unless it is placed as described in the included readme.txt

# DownloadDirFullPath=X:\FullPath\To\Downloads
# DownloadDirPartialPath=Full\Path\From\Drive\Root\To\Downloads
# DownloadDirPortableAppsRootPath=Path\From\Platform\Root\To\Downloads

# The above allow you to custom redirect the location gPodder Portable uses for downloads
# it is meant for advanced users.  Only one of the 3 options should be used by removing the # and space from the line
# the first option is a full path to downloads and can be on another drive
# the second is a path relative to the drive letter X:\
# the 3rd is relative to the root of a PortableApps.com Platform install (where Start.exe is)

These 3 options will let you place your downloads directory on another drive, in a directory relative to the root of the drive or in a directory relative to the PortableApps.com Platform root where Start.exe (especially useful for custom locations in conjunction with something like DropBox).

Sometimes, the impossible can become possible, if you're awesome!

3.3.0

I see with 3.3.0 the fix:
Respect GPODDER_DOWNLOAD_DIR in the environment (bug 466)
is included.

Does this affect gpodder portable, should I be doing anything special to choose the download directory now?

Thanks.

Nope

It's still hardwired to the exact same place as in 3.2.0. gPodder still has no GUI for adjusting the download directory and no internal setting for the location. It's just an environment variable for advanced users to set a full path to an alternate download directory. It is not used by gPodder Portable.

Sometimes, the impossible can become possible, if you're awesome!

User-Defined Download Directory

Pardon my ignorance, what is the current method (if any) to have gpodder download podcasts to a user-defined directory?

Thanks for your future reply and all your hardwork on portableapps,
spud77

Fixed

The directory is fixed to the config\Downloads directory in the portable version. We use the GPODDER_DOWNLOAD_DIR environment variable to point it there now. You could, in theory, edit the gPodderPortable.ini file within the App\AppInfo\Launcher directory and change the GPODDER_DOWNLOAD_DIR=%PAL:DataDir%\config\Downloads line to something else. But it would be reset on each upgrade.

Sometimes, the impossible can become possible, if you're awesome!

yeah, this should be fixed so

yeah, this should be fixed so its a GUI option. nobody wants GB's of data downloaded to the same location they keep their portable app stuff. Sad

can't believe it wasn't in the original installer program either.

Portable You Can

You can specify it in the portable version at least using the additions I made:
http://portableapps.com/node/32057#comment-195919

Sometimes, the impossible can become possible, if you're awesome!