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

Try to guess season from episode names if directory does not contain it #68

Open
plotski opened this issue Jun 1, 2020 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@plotski
Copy link
Collaborator

plotski commented Jun 1, 2020

$ pythonbits 'any/existing/path/without/season/info' -c tv -f description
[...]
Traceback (most recent call last):
  File "/path/to/pythonBits/pythonbits/__main__.py", line 137, in main
    _main(Category, set_fields, get_fields)
  File "/path/to/pythonBits/pythonbits/__main__.py", line 113, in _main
    sub.show_fields(get_fields)
  File "/path/to/pythonBits/pythonbits/bb.py", line 51, in show_fields
    return super(BbSubmission, self).show_fields(
  File "/path/to/pythonBits/pythonbits/submission.py", line 236, in show_fields
    val = self[field]
  File "/path/to/pythonBits/pythonbits/submission.py", line 115, in __getitem__
    rv = field_renderer()
  File "/path/to/pythonBits/pythonbits/bb.py", line 633, in _render_description
    sections = [("Description", self['section_description']),
  File "/path/to/pythonBits/pythonbits/submission.py", line 115, in __getitem__
    rv = field_renderer()
  File "/path/to/pythonBits/pythonbits/bb.py", line 561, in _render_section_description
    summary = self['summary']
  File "/path/to/pythonBits/pythonbits/submission.py", line 115, in __getitem__
    rv = field_renderer()
  File "/path/to/pythonBits/pythonbits/bb.py", line 557, in _render_summary
    result = t.search(self['tv_specifier'])
  File "/path/to/pythonBits/pythonbits/submission.py", line 115, in __getitem__
    rv = field_renderer()
  File "/path/to/pythonBits/pythonbits/bb.py", line 249, in _render_tv_specifier
    return TvSpecifier(title, guess['season'],
KeyError: 'season'

This was fixed by my ugly confirmed_guess hack but is now an issue again after you
reverted it.

As you said in the PR comment, this can be fixed by explicitly mentioning the season in
the TITLE argument, but the exception above leaves the user hanging with no information
what went wrong and what to do.

@mueslo
Copy link
Owner

mueslo commented Jun 1, 2020

Sorry about that! Can you give example filenames for which this happens?

@plotski
Copy link
Collaborator Author

plotski commented Jun 1, 2020

Use any path of an existing file or directory, it just can't contain any season
information. This should reproduce the issue:

$ touch foo
$ pythonbits foo -c tv -f description

@mueslo
Copy link
Owner

mueslo commented Jun 1, 2020

Is this for miniseries? Why does your directory not contain the season? (kb.php?id=30)

From README.md:

In case the media title and type cannot be guessed from the path alone, you can explicitly specify them, e.g. pythonbits <path> "Doctor Who (2005) S06" or pythonbits <path> -c movie.

@mueslo mueslo added question Further information is requested more information needed More information or details needed before this can be worked on and removed question Further information is requested labels Jun 1, 2020
@plotski
Copy link
Collaborator Author

plotski commented Jun 1, 2020

I pm'd you an example.

Generally speaking, relying on user input is just asking for disaster. If the expected
input is not there, software shouldn't just shrug and explode into the user's face. The
least it should do is tell the user what's wrong and how to recover.

I think "This doesn't make any sense, please confirm this input: ..." is the most
user-friendly way, but throwing an error like Missing season (try providing the TITLE argument, e.g. "<auto-fill in source name here> S01") would also be acceptable.

@mueslo mueslo added enhancement New feature or request and removed more information needed More information or details needed before this can be worked on labels Jun 3, 2020
@mueslo mueslo changed the title KeyError: 'season' Try to guess season from episode names if directory does not contain it Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants