Skip to content

Commit

Permalink
fix folder name assets
Browse files Browse the repository at this point in the history
  • Loading branch information
Arial-Z committed Feb 17, 2024
1 parent 7d569c8 commit aa30269
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions plex_animes_export.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from plexapi.server import PlexServer
from dotenv import load_dotenv
from os import environ, path
from os.path import normpath, basename
import re
import pathlib

# Find .env file
basedir = path.abspath(path.dirname(__file__))
Expand All @@ -23,8 +23,7 @@
if ( tvdbid ) :
tvdb = str(tvdbid.group(1))
location = str(video.locations)[2:-2]
path = pathlib.PurePath(location)
folder = str(path.name)
folder = str(basename(normpath(location)))
seasons = str(video.seasons())
seasonslist = re.findall("\-(\d*)\>", seasons)
cleanseasonslist = ',' .join(seasonslist)
Expand Down
5 changes: 2 additions & 3 deletions plex_movies_export.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from plexapi.server import PlexServer
from dotenv import load_dotenv
from os import environ, path
from os.path import normpath, basename
import re
import pathlib

# Find .env file
basedir = path.abspath(path.dirname(__file__))
Expand All @@ -23,8 +23,7 @@
if ( imdbid ) :
imdb = str(imdbid.group(1))
location = str(video.locations)[2:-2]
path = pathlib.PurePath(location)
folder = str(path.parent.name)
folder = str(basename(normpath(location)))
export=(imdb + "\t" + title + "\t" + folder + "\n")
export_plex.write(export)
else :
Expand Down

0 comments on commit aa30269

Please sign in to comment.