-
Notifications
You must be signed in to change notification settings - Fork 5
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
transfer issue 4 #1
Comments
Hey, playlist_songs = ampache.playlist_songs(ampache_url, ampache_api, single_playlist) ? That would be awesome :-) |
ooops... you archived the original thread. I was just trying to add a comment - I'll leave it here not to lose what I was writing. The following is about the custom Metadata implementation. Once you got the original moved, I'll copy it there... Cheers! Code comment for the function update_ext_item starting at line 1549 of song.class.php mentions a song_ext_info table that I neither found in the database, nor other references to it in code. Was this from a previous version, maybe? A hook to external metadata files would be the right thing. Now I see what you mean by confusing implementation... To me, it looks like it requires a rewrite. It's just not made for what I want to do with it... Ampache is very MP3 centric. But maybe that's ok for most users. Logged in as an admin user, under Server Config/System (in the Edit Server Preferences dialog) I defined two Custom Metadata fields. Surprisingly, their names get written into the All we get is two "virtual" field names in a user preference table. Where should the values be written to? Again, it is presumed they are already present in the files. One might expect these fields to be attached to all songs (after the potentially dangerous altering of the song table structure to allow for two additional fields). But when does this happen - if at all? Verifying the catalogs does not trigger it. I have not found a function for this in the Metadata implementation. "Tags" in Ampache could be a workaround to input custom metadata - at least there already is a table for them. Some require input validation, like the ISRC. That would be feasible on the client side, but the whole approach is not really elegant. |
I've got the fix for this @DjTuxeedo
@AshotN json_data will need to do the same.
|
That's valid json, @DjTuxeedo i think this covers you completely
|
I forgot I need to put a browse/search filter too |
What is really the difference between metadata, custom metadata and tags? Are tags always Genres? They do have their own type "tag", while metadata are text and custom metadata are "mixed". The mixed type means what exactly? Call me a dummy, but I only partly understand the docs on search here - |
Sure, metadata is the only mixed type whish isn't great as it adds another search array. I only just worked out what mixed was when we started on this. I'm spending my day at home tomorrow so I'll be working on a few ampache things and will put up some examples. The mixed types actually need another writeup and the current code for python doesn't support the additional rule required. In the docs folder here I think example.py uses a regular advanced search command as well |
Thank you for the great documentation and examples! I am confused about the purpose of the custom metadata feature. Near the end of Ampache's debug window, I found the custom metadata I had wanted to add: Now this looks like I have excluded them instead of adding (which I suppose does not work). The array seems to contain the exluded custom metadata. In Custom metadata - Define field list I entered "encoding", and it also appears in disabled_custom_metadata_field_input then. But still, no matter what I add or delete here, the Song Edit Dialog and what I see after clicking on More Metadata remains the same with all wav data. Only Encoding and Audio Codec are listed here, and I cannot remove the fields by entering them in disabled_custom_metadata_field_input. |
I wonder if because wav files are not tagged they can't be added into the files? I think we might have to add 'tagging' into the api to allow this. |
Tagging in the API would be great! As you said, there should be a (customizable) default list of empty fields that gets initialised on import also for wav files. As these contain very few information, they otherwise will have only Encoding and Audio Codec as Meta Tags. There is the Broadcast Wave Format, which has extended information inside the files (if that is what you mean). But it is not widely used, and there are compatibility isssues. |
okay, @DjTuxeedo and @Rhythm-of-Time this is almost done here. (at least for python) if we look at methods to add for metadata i have at least these Metadata Action API MethodsUpdate tags and metadata for files.
Then when we think about tagging i think they go into the object itself. this will edit anything in the db table for each object (e.g. name, prefix, etc) this will have to have write_id3 enabled to be allowed as the tags will overwrite when read again. (i'm not sure if this will edit vorbis/flac files?!)
I've added the code into Ampache api for the custom fields and python to allow advanced metadata searches so if you're happy with these new methods i'll close this issue and put the new methods in the api project |
I'm sorry @lachlan-00, My first problem seems to be that: Setup is: |
I can pretty much say the same - it takes time to think and analyse... Thanks a lot for your work so far, and let's leave this open a bit. For now, I am researching some questions: Where do the ids and names in the table metadata_field come from? What is the "Public" column used for? It looks like in catalog.class.php the method update_song_from_tags takes the decision which metadata tags are included by default. vainfo.class.php is also doing some work cleaning up tags (metadata) which are not found in the database. I see many metadata mentioned here, but the ISRC is not mentioned. There is no "default list" of tags. But regarding Ampache's many features there is definitely need for more tags than the standard, depending on use case. How to configure this, i.e. specify which metadata to use (display) and define data types and field lenghts? Or is this included in your project schedule already... In general, it should be possible to write tags also in Vorbis and FLAC (as Vorbis comments only). I am not sure if it's advisable to overwrite metadata within files. Optionally they should be kept as is with additional metadata in the Ampache database. |
annoyingly they are ad-hoc based on when they are read from the tags of the song and added to the database.
Probably to allow a user to create their own custom tags but i don't think it's used anywhere. The metadata right now i can see is only for songs and only created publicly. I think the only way it's been used previously has been in the ui. |
I stuffed an MP3 with all ID3v2.3 tags I could find. Now the metadata_field table looks like this:
GetID3's guess looks pretty much complete. IDs 2 and 4 - 11 do not appear here, they are probably the ID3v1 stuff like album, artist, title and so on that appear elsewhere as song properties. Now that the database has been fed with the dummy data, it would be clear which ID to adress by a newly created field (if we do not want to create an entirely new one - that would require a new entry in metadata_field). Also custom metadata could go there - if the API can change this table later. It's a bit awkward if we pick up the way GetID3 guesses the tags on the fly, but by using it's ID scheme we at least stay compatible with the import procedure as it is now. So a workaround would be to set up the metadata fields table similar to the above. Maybe some tags are missing, still? Barcodes are not here - should be an album property, just like catalog numbers. You adressed these already in the latest update. |
I think a good goal would be to move more file tags into song/song_data album/artist into those tables. This would ideally reduce the need for enabling this feature. Things like bpm and file specific tags should at least be put into song data. If you can split up your metadata list into Song I think I can just work them into those tables |
@DjTuxeedo same for you. If you can send me a list of tags or file info you want to pull out of the custom metadata I think it would be better in the object tables. After using it I don't really like it compared to putting it in the tables |
Sorry for taking long time for thinking on this... I was digging through some implementations that I have to deal with. The largest metadata set (Soundmouse) features 176 columns. It would certainly be exaggerated to include all these in Ampache's tables - this needs to be reduced to a reasonable amount. Though it is not very likely that we'll frequently have that 6th arranger Soundmouse provides for, sometimes a second composer / publisher may be present. There still are cases where "custom data" are necessary. One example would be entering a track ID number from a collecting society. It would probably be too much to list all of the societies in Ampache. Instead a custom field should be created. I would propose extending the existing metadata table to maintain backwards compatibility with existing collections - or is there a smarter way? Most of the metadata should go into Song: Album Artist By the way, I am just finding that two weeks ago three artists "got lost" from the database (that I am sure I did not delete). Let me see what else happened this day... did I update... The first artist I created had ID 19 last time I saw him. I wonder if recreating the records and counting up IDs does not create trouble somewhere. But no: That day, I had tried to Disable Custom Metadata and did a Database Update. This rescanned the files (which are wavs without artist tag). It seems that the rescan killed the artist I had created and "attached" to this file. Weird. |
Did it make the wav files orphans? Or delete other data in the columns for song? The garbage collection is based around the song table so it would clean up anything not in a file. I don't have a lot of wav files but I'll have to put some in and try to follow the process. We need to make sure if it doesn't find tags or creates empty ones we don't remove manual ones |
Ampache has a pretty bad history for untagged file types but I think we can work around it. |
Well, it made all the wav files orphans, deleted all artists and all albums which were not from a MP3 file. Thorough job. I did not expect this - garbage collection seems to relies on what is in the files and removes the manual entries (which are not present in the wav files). I think it would be best to have a separate metadata record for each track, in a simple table instead of the construct currently used. I mean the columns containing all metadata names / types, and the rows identified by song / track id. There should also be a column for the file path, track title, and library (possibly sublibrary) name which is the Ampache catalog(s). It would be very handy to be able export this table in a variety of ways (for fingerprinting, registration and reporting). Additionally, we need a method for adding columns ("custom data") in case the default metadata (columns) are not enough - which we should try to avoid, and a tool to synchronize this with file metadata (if wanted / possible). The getid3 methods could be kept in order not to change too much code at a time, but they need to be tamed. Currently, we don't really have control. Maybe you already have an idea how to deal with this? I don't really know where to start - but I am ready to help if I can. |
Verify will read for tags and replace the data. I know what to do to fix that and why it happened to you at least. Ampache replaced the info with the tags it read. (Which were empty) :/ There is already song and song_data which is meant for the extra fields. The song table itself probably doesn't need to be expanded further. First step is stop replacing tags with empty fields. Garbage collection looks for things not attached to a file and deletes so we have to stop that. Second step is add extra columns for the most common missing fields to at least cover all the default id3 tags. 3rd it's a good idea to have wav files ignored by the vainfo class so it doesn't accidentally overwrite itself. I've done a bit of tag movement last year so it's not a big deal to add more. Basically I just add the columns in the db, vainfo and song/album/artist classes. Adding custom fields is probably staying in custom_metadata. Songs are static IDs until deleted / moved so that's the best spot for edge cases. Lastly we support multiple genres so I want song_data to store a full artist array for artist ids in each song. Double lastly I want to separate song artist and album artist into separate search terms. Artist Then provide an option to list and search albums /artist pages when they are the album artist. (Very highly requested feature) |
I forgot to clarify that album and artist should be deleted if present. They might be in object_count but in user activity it's a single row |
https://github.com/lachlan-00/python3-ampache/issues/4
The text was updated successfully, but these errors were encountered: