johnsturgeon / plex-tools Goto Github PK
View Code? Open in Web Editor NEWUtilities and scripts for plex using the Plex API
License: MIT License
Utilities and scripts for plex using the Plex API
License: MIT License
I'm currently going through the process of tagging my ~10k track library but am worried as I know my plex library may not last forever. Ten years is a good run for many software applications.
Any way - it would be awesome to have the ability to sync track ratings from the plex database into mp3 IDv3 rating tag. I've seen some discussion regarding exacltly which tag ratings are stored in, as it can differ between media library applications such as MediaMonkey / MusicBee / AIMP. Perhaps the rating field could be user-definible to make this feature more adaptable.
According to id3.org the rating tag is the "Popularimeter" field - https://id3.org/id3v2.3.0.
Probably want to warn the user here that there might be a rate limit on the API calls. I'm probably going to provide an extra warning if the playlist exceeds 100
So it seems that Shazam API is not great. The first album I threw at it was "Acoustic Alchemy" "Against the Grain" and unfortunately it mis-matched several songs opting instead for the version where they were performing with an orchestra.
I think as a fallback, we could try acoustID (or maybe even the other way around). The downside is that this will require the user to install "Chromaprint"
Another option is SoundHound, but this would require registration for an API key.
Neither option is great.
I need to package all this up and add it to PyPi
def mapped_filepath(self, path_map: Dict[str, str]) -> str:
"""
Replaces the remote root of the file with the local root given
Args:
path_map: Dictionary in the form of
{
remote_root1: local_root1,
remote_root2: local_root2,
...
}
Returns:
the full local path the current track
"""
new_path: str = self.filepath
for key, value in path_map.items():
if key in self.filepath:
new_path = self.filepath.replace(key, value)
return new_path
def is_duplicate(self, other):
return self.hash_val == other.hash_val
def is_identical(self, other):
return self.track == other.track
Along with property
self.hash_val = str(f"{self.title}{self.artist}{self.album}{self.duration}")
Issue: I have a library with over 120 000 songs, and I ran this program, and there are 1034 duplicates found. There seems to be no option to just automatically go through the songs. It's unfortunately unusable for that reason.
Proposed solution: Add a feature, which asks the user if they want to use an automatic process, which uses few different methods for sorting. Some that came into my mind:
Those options could be merged so let's say "I want the songs where creation date does not matter, but if the track is bigger, and has larger bit rate and has (1) in the file name, delete it right away"
Justification: Better user experience for users with a tad larger libraries. Also helps users to gain more power over which versions they want to keep and which to delete.
I've disabled it for now to get the linter passing, but I really need to refactor that in the next major overhaul
I'm going to use the same authentication .env workflow as the other scripts, so it only makes sense to write it so that the other script can eventually just include it.
I got some unit tests in, but it would be nice to finish them and cover deduplex
as well.
Looking into pyinstaller for that
The issue was raised here #14. Many users have multiple libraries, and instead of putting it into your .env, you can choose at run time a list of libraries to go through.
Now that it looks like there will be some contributors, I think it's time to start to write some unit tests.
Many times this won't be run on the same machine as a remote Plex server, therefore we need to create a 'map' to the root of the library folder with a folder that's accessible to the script.
Getting some contributors is critical to the code's survival, but I need to make sure there are some reasonable guidelines for contributors.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.