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

TypeError: 'int' object is not iterable #72

Closed
tordenflesk opened this issue Mar 31, 2020 · 2 comments
Closed

TypeError: 'int' object is not iterable #72

tordenflesk opened this issue Mar 31, 2020 · 2 comments

Comments

@tordenflesk
Copy link

Installed poetry and Pendulum manually according to this to bypass initial install issue.
Then, I think I've managed to setup a valid config file, but I'm getting this output from 'organize config --debug':

Traceback (most recent call last):
  File "C:\Python38\lib\runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python38\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python38\Scripts\organize.exe\__main__.py", line 7, in <module>
  File "C:\Python38\lib\site-packages\organize\cli.py", line 65, in main
    config_debug(config_path)
  File "C:\Python38\lib\site-packages\organize\cli.py", line 123, in config_debug
    rules = config.rules
  File "C:\Python38\lib\site-packages\organize\config.py", line 160, in rules
    rule_filters = list(self.instantiate_filters(rule_item))
  File "C:\Python38\lib\site-packages\organize\config.py", line 121, in instantiate_filters
    yield self._class_instance_with_args(filter_class, args)
  File "C:\Python38\lib\site-packages\organize\config.py", line 98, in _class_instance_with_args
    return Cls(**args)
  File "C:\Python38\lib\site-packages\organize\filters\filename.py", line 81, in __init__
    self.startswith = self.create_list(startswith, case_sensitive)
  File "C:\Python38\lib\site-packages\organize\filters\filename.py", line 103, in create_list
    x = [str(x) for x in x]
TypeError: 'int' object is not iterable

slightly anonymized config:

rules:
  - folders:
        - H:\X\Finished\X
    filters:
        - lastmodified:
            minutes: 40
            mode: older
        - extension:
            - mkv
            - mp4
    actions:
      - copy: G:\
      
    # optional settings:
    enabled: true
    subfolders: true

  - folders:
        - H:\X\Finished\X_h265ize
    filters: 
      - lastmodified:
          minutes: 40
          mode: older
      - extension:
        - mkv
        - mp4
        - avi
        - mpg
        - mpeg
        - wmv
        - m4v
        - flv
    actions:
      - copy: E:\h265ize
      
    # optional settings:
    enabled: true
    subfolders: true

  - folders:
      - E:\h265ize
    filters: 
      - lastmodified:
          minutes: 5
          mode: older
      - extension:
        - mkv
    actions:
      - Move: G:\
      
    # optional settings:
    enabled: true
    subfolders: false
    
  - folders:
      - \\Srv-omv01\data00\h265ize
    filters: 
      - lastmodified:
          minutes: 5
          mode: older
      - extension:
        - mkv
    actions:
      - Move: G:\
      
    # optional settings:
    enabled: true
    subfolders: false
    
  - folders:
      - E:\Podcasts\Downloads\X
    filters: 
      - filename:
          startswith: 2020
      - lastmodified:
          minutes: 40
          mode: newer
      - extension:
        - mp3        
    actions:
      - copy: F:\Podcast_Archive\X\2020\
      
    # optional settings:
    enabled: true
    subfolders: true
  - folders:
      - E:\Podcasts\Downloads\X
    filters: 
      - filename:
          startswith: 2020
      - lastmodified:
          minutes: 40
          mode: newer
      - extension:
        - mp3        
    actions:
      - copy: F:\Podcast_Archive\X\2020\
      
    # optional settings:
    enabled: true
    subfolders: true
  - folders:
      - E:\Podcasts\Downloads\X
    filters: 
      - lastmodified:
          minutes: 40
          mode: newer
      - extension:
        - mp3        
    actions:
      - copy: F:\Podcast_Archive\X
      
    # optional settings:
    enabled: true
    subfolders: true
@tfeldmann
Copy link
Owner

Hey you found a bug in the filename filter. Give me a few minutes to release an update and thank you for the bug report!

@tfeldmann
Copy link
Owner

I just released v1.8.2 which should fix this bug. Can you try again?

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