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

Can't convert Absolute Number to Season+Episode #207

Open
AntonyCilleros opened this issue Mar 20, 2022 · 1 comment
Open

Can't convert Absolute Number to Season+Episode #207

AntonyCilleros opened this issue Mar 20, 2022 · 1 comment

Comments

@AntonyCilleros
Copy link

Hello

I have a series (Yu Yu Hakusho) named with absolute number like :
"Yu Yu Hakusho - E106 - The Battle of Father and Son.mkv"
and I would like to have it like that :
"Yu Yu Hakusho - S04E12 - The Battle of Father and Son.mkv"

So my issue is that I can't use %(seasonnumber)02d in filename_with_episode_no_season because it returns me this :

Loading config: settings
####################
# Starting tvnamer
# Found 43 episodes
####################
# Processing file: Yu Yu Hakusho - E001 - Surprised to be Dead.mkv
# Detected series: Yu Yu Hakusho (episode: 1)
Traceback (most recent call last):
  File "/home/raytek/.local/bin/tvnamer", line 8, in <module>
    sys.exit(main())
  File "/home/raytek/.local/lib/python3.8/site-packages/tvnamer/main.py", line 474, in main
    tvnamer(paths = sorted(args))
  File "/home/raytek/.local/lib/python3.8/site-packages/tvnamer/main.py", line 370, in tvnamer
    processFile(tvdb_instance, episode)
  File "/home/raytek/.local/lib/python3.8/site-packages/tvnamer/main.py", line 207, in processFile
    newName = episode.generateFilename()
  File "/home/raytek/.local/lib/python3.8/site-packages/tvnamer/utils.py", line 770, in generateFilename
    fname = Config[self.CFG_KEY_WITH_EP] % epdata
KeyError: 'seasonnumber'

Is there a way to convert an "absolute number" to an "aired order" (Season+Episode) ?

Sorry if I missed something and thanks anyway for this program !

@dbr
Copy link
Owner

dbr commented Apr 7, 2022

There's not currently a way to do this, as each type of parsed episode only exposes the "relevant" data (e.g the NoSeasonEpisodeInfo class only exposed series name and episode number), for example here:

tvnamer/tvnamer/data.py

Lines 528 to 533 in 2e1e969

epdata = {
'seriesname': self.seriesname,
'episode': epno,
'episodename': self.episodename,
'ext': prep_extension,
}

In retrospect each type should expose all the available data, which isn't a massive change but would probably require some refactoring - however I'm no longer actively developing the tool, so unfortunately it's unlikely to be fixed anytime soon

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