diff --git a/README.md b/README.md index efb14a8..e64d90a 100644 --- a/README.md +++ b/README.md @@ -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. -* `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-name` *(optional)* custom name for the image (default is `folder`) * `rename-episodes` *(optional)* boolean value to enable renaming of podcast episodes (default is `false`) diff --git a/podfox/__init__.py b/podfox/__init__.py index a2cacbc..b144a54 100755 --- a/podfox/__init__.py +++ b/podfox/__init__.py @@ -316,6 +316,8 @@ def download_multiple(feed, maxnum): for episode in feed['episodes']: if maxnum == 0: break + if episode['downloaded']: + maxnum -= 1 if not episode['downloaded']: if 'rename_episodes' in CONFIGURATION and CONFIGURATION['rename_episodes']: filename = rename_episode(feed['shortname'], episode['published'], @@ -499,8 +501,10 @@ def main(): if arguments['download']: if arguments['--how-many']: maxnum = int(arguments['--how-many']) - else: + else if 'maxnum' in CONFIGURATION: maxnum = CONFIGURATION['maxnum'] + else: + maxnum = -1 # download episodes for a specific feed if arguments['<shortname>']: feed = find_feed(arguments['<shortname>']) diff --git a/setup.py b/setup.py index d21aef7..f1bb8d0 100644 --- a/setup.py +++ b/setup.py @@ -3,18 +3,10 @@ from setuptools import setup with open('requirements.txt') as f: required = f.read().splitlines() -setup(name='podfox', - 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, +setup(name='podfox', zip_safe=False, entry_points={ - 'console_scripts' : [ - 'podfox = podfox.__init__:main' + 'console_scripts': [ + 'podfox = podfox.__init__:main' ] }, install_requires=[