mirror of
https://github.com/mwalbeck/podfox.git
synced 2025-04-10 08:37:29 +00:00
Change behavior of maxnum
This commit is contained in:
parent
2f4ffa73ae
commit
f1861cb5b4
3 changed files with 9 additions and 13 deletions
|
@ -32,7 +32,7 @@ Here is mine:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* `podcast-directory` is your main directory to store podcast data. This directory should be empty before you begin adding feeds.
|
* `podcast-directory` is your main directory to store podcast data. This directory should be empty before you begin adding feeds.
|
||||||
* `maxnum` describes the maximum number of episodes you want to download with a single `download`-command. -1 for no limit.
|
* `maxnum` *(optional)* download the newest of noted amount of episodes from podcast. When a new episodes comes out the oldest will be ignore if deleted (default is no limit)
|
||||||
* `cover-image` *(optional)* boolean value to enable downloading of podcast image (default is `false`)
|
* `cover-image` *(optional)* boolean value to enable downloading of podcast image (default is `false`)
|
||||||
* `cover-image-name` *(optional)* custom name for the image (default is `folder`)
|
* `cover-image-name` *(optional)* custom name for the image (default is `folder`)
|
||||||
* `rename-episodes` *(optional)* boolean value to enable renaming of podcast episodes (default is `false`)
|
* `rename-episodes` *(optional)* boolean value to enable renaming of podcast episodes (default is `false`)
|
||||||
|
|
|
@ -316,6 +316,8 @@ def download_multiple(feed, maxnum):
|
||||||
for episode in feed['episodes']:
|
for episode in feed['episodes']:
|
||||||
if maxnum == 0:
|
if maxnum == 0:
|
||||||
break
|
break
|
||||||
|
if episode['downloaded']:
|
||||||
|
maxnum -= 1
|
||||||
if not episode['downloaded']:
|
if not episode['downloaded']:
|
||||||
if 'rename_episodes' in CONFIGURATION and CONFIGURATION['rename_episodes']:
|
if 'rename_episodes' in CONFIGURATION and CONFIGURATION['rename_episodes']:
|
||||||
filename = rename_episode(feed['shortname'], episode['published'],
|
filename = rename_episode(feed['shortname'], episode['published'],
|
||||||
|
@ -499,8 +501,10 @@ def main():
|
||||||
if arguments['download']:
|
if arguments['download']:
|
||||||
if arguments['--how-many']:
|
if arguments['--how-many']:
|
||||||
maxnum = int(arguments['--how-many'])
|
maxnum = int(arguments['--how-many'])
|
||||||
else:
|
else if 'maxnum' in CONFIGURATION:
|
||||||
maxnum = CONFIGURATION['maxnum']
|
maxnum = CONFIGURATION['maxnum']
|
||||||
|
else:
|
||||||
|
maxnum = -1
|
||||||
# download episodes for a specific feed
|
# download episodes for a specific feed
|
||||||
if arguments['<shortname>']:
|
if arguments['<shortname>']:
|
||||||
feed = find_feed(arguments['<shortname>'])
|
feed = find_feed(arguments['<shortname>'])
|
||||||
|
|
14
setup.py
14
setup.py
|
@ -3,18 +3,10 @@ from setuptools import setup
|
||||||
with open('requirements.txt') as f:
|
with open('requirements.txt') as f:
|
||||||
required = f.read().splitlines()
|
required = f.read().splitlines()
|
||||||
|
|
||||||
setup(name='podfox',
|
setup(name='podfox', zip_safe=False,
|
||||||
version='0.1.3',
|
|
||||||
description='Podcatcher for the terminal',
|
|
||||||
url='http://github.com/mwalbeck/podfox',
|
|
||||||
author='Magnus Walbeck',
|
|
||||||
author_email='mw@mwalbeck.org',
|
|
||||||
license='GPLv3',
|
|
||||||
packages=['podfox'],
|
|
||||||
zip_safe=False,
|
|
||||||
entry_points={
|
entry_points={
|
||||||
'console_scripts' : [
|
'console_scripts': [
|
||||||
'podfox = podfox.__init__:main'
|
'podfox = podfox.__init__:main'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
install_requires=[
|
install_requires=[
|
||||||
|
|
Loading…
Add table
Reference in a new issue