cjcodeproj / medialibrary

Python code to read XML media files
MIT License
2 stars 0 forks source link

Movie list fails if there are no movies #200

Open cjcodeproj opened 2 months ago

cjcodeproj commented 2 months ago

The code can't handle an empty set.

$ python -m media.tools.movies.list --mediapath ~/xml/m/vtmedia-schema/examples/music/ --group genre
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/chrisj/wpython/medialibrary/src/media/tools/movies/list.py", line 63, in <module>
    main_cli()
  File "/home/chrisj/wpython/medialibrary/src/media/tools/movies/list.py", line 59, in main_cli
    print(movie_report.report())
          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/chrisj/wpython/medialibrary/src/media/tools/movies/common.py", line 163, in report
    self.organizer.set_grouping(self.group)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'set_grouping'