Comments (10)
Never mind. Thanks for the help indeed.
If you need me to test, just let me know... and take your time. I am in no hurry.
from tone.
Hey @rockonedege,
thank you, this is a good feature request. Unfortunately the dump
part is not possible out of the box at the moment, but I will definitely give this a go for the next release 0.1.6
. It is important to have such a thing.
- Add
--export-file
(and optionally--export-file-template
) parameters fordump
command (e.g.--export-file
and--export-file-template="{filename}.tone.json"
)--export-file
is boolean, will switch the default format totonejson
and uses the--export-file-template
as current file to dump with the valid extension--export-file-template
is for later and may influence the way exports can be done
- add
SerializerService
to JavaScript engine to import and export file contents in custom JavaScript taggers - investigate
--mode=overwriteNonEmpty
or similar option to force overwrite tags
If you are on Linux or macOS, you could try something like this for the dump:
find . -type f -name '*.m4b' -exec /bin/sh -c 'FULLPATH="{}";NOEXT="${FULLPATH%.m4b}" && tone dump "$FULLPATH" --format=json > "$NOEXT.tone.json"' \;
Basically this uses find and some shell kung fu to call tone dump
for every m4b
file and then exports it into <filename>.tone.json
. Feel free to replace m4b
with other extensions.
Oh, and backup your files before doing this recursively... it may lead to unexpected consequences :-)
from tone.
Thanks, I will give it try.
Assuming it works as expect, what is the counterpart tag
option to import the json
and apply it to audio files?
from tone.
tone tag audiobooks/ --auto-import=ToneJson
If i remember correctly
from tone.
looking at the examples in the documents
tone tag --debug --auto-import=covers --meta-additional-field ©st3=testing input.m4b --dry-run
--auto-import
seems expect a field name, not a json file? I am not sure I understand teh auto-
part in the naming.
there's another option --meta-tone-json-file
seems more appropriate by name, but I fund no example.
from tone.
--auto-import
is an Enumberable containing the following possible case insensitive supporting values (not filenames)
- Covers
- Chapters
- ToneJson
- Ffmetadata
Given one of these, tone
will look for a specific file beneath to the location of the file(s) to tag, where --meta-tone-json-file
means ONE specific file.
So --auto-import=ToneJson
is made for recursive scanning and will take every , look for an according <filename-without-extension>.tone.json
and import it if it finds one.
Example:
Fantasy/Harry Potter/1/Harry Potter 1.m4b
=>Fantasy/Harry Potter/1/Harry Potter 1.tone.json
Try it, it will do, what you want.
from tone.
The dump
command works perfectly and generates a tone.json
file for each .mp3
.
then I picked one of the tone json files. changed(cleared) some fields
"meta": {
"album": "¸ü¶à×ÊÔ´Çë¼Ócqhdy2016",
"artist": "Ò»ÊÖ×ÊÔ´¹Ù·½Í¬²½¸üÐÂÇë¼Ó΢ÐÅ£ºcqhdy2016",
"comment": "¸ü¶à×ÊÔ´Çë¼Ócqhdy2016",
"genre": "Ò»ÊÖ×ÊÔ´¹Ù·½Í¬²½¸üÐÂÇë¼Ó΢ÐÅ£ºcqhdy2016",
"recordingDate": "2017-01-01T00:00:00",
"title": "1 - 李靖难成仙 下山当总兵"
},
to
"meta": {
"album": "",
"artist": "",
"comment": "",
"genre": "",
"recordingDate": "2017-01-01T00:00:00",
"title": "1 - 李靖难成仙 下山当总兵"
},
then I tried to apply the changes back to the .mp3
,
$ tone tag . --auto-import ToneJson
Tagging 193 files, continue? [y/n] (y): y
── unchanged: /mnt/g/audio-test/超极封神榜/1 - 李靖难成仙 下山当总兵.mp3 ──────────────────────────────────────────────────────────────────────
No luck.
I also tried
$ tone tag . --auto-import Ffmetadata
Tagging 193 files, continue? [y/n] (y): y
Error: Object reference not set to an instance of an object.
no luck either.
BTW, I am testing on WSL(Ubuntu) on Windows 10
from tone.
then I picked one of the tone json files. changed(cleared) some fields
Ah, I see. Clearing fields is special... I can't simply remove fields that have an empty value or are not set, because in this case it would remove EVERY tag, that is not in the export file which is mostly not the wanted behaviour in most cases.
atldotnet
treats ""
(empty string) same as null
in most cases and cannot differ between UNSET value and SET="". I already discussed this with the maintainer and was working on a fix/workaround, but I did not have the time to finish it.
To remove fields, use e.g. --meta-remove-property=album
. Maybe I need to reinvestigate this for this feature.
from tone.
I did not really mean to remove a field, just wanted to clear some ad being put there, but that's a triaval difference I could ignore and take either reaults.
So I put some random characters to test it, and it remains unchanged still. To give you more context, here's the complete exported tone json file to be imported
{
"audio": {
"bitrate": 160,
"format": "MPEG Audio (Layer III)",
"formatShort": "MPEG",
"sampleRate": 44100.0,
"duration": 710920.0,
"channels": {
"count": 2,
"description": "Joint Stereo"
},
"frames": {
"offset": 193,
"length": 14218449
},
"metaFormat": [
"id3V23"
]
},
"meta": {
"album": "fghdf",
"artist": "dfffffsd",
"comment": "sdfgfg",
"genre": "sdfgd",
"recordingDate": "2017-01-01T00:00:00",
"title": "1 - 李靖难成仙 下山当总兵"
},
"file": {
"size": 14218642,
"created": "2019-11-19T07:59:40.4762029+08:00",
"modified": "2019-11-19T07:59:40.4762029+08:00",
"accessed": "2023-04-12T22:25:12.4108919+08:00",
"path": "/mnt/g/audio-test/超极封神榜",
"name": "1 - 李靖难成仙 下山当总兵.mp3"
}
}
from tone.
Phew, you give me a lot to investigate.
According to this line of code, it should work like expected.
I updated the featurette in my first comment - so I have to check, what is wrong here. Sorry, might take a while.
from tone.
Related Issues (20)
- Could not find file with double quote in name and folder HOT 3
- Unable to remove movement tag with --meta-remove-property HOT 3
- Enhancement - Allow to set only year for all date properties
- --meta-subtitle is not written if file does contain any metadata HOT 2
- tone tag use too much ram HOT 3
- When auto importing covers, every file gets the same cover image HOT 5
- How to identify CTOC (Table of Contents) chaps from mp3 HOT 5
- Incorrect Next track ID after import chapters HOT 5
- Not real issue, only works with block storage HOT 2
- Some value of returned JSON are malformed HOT 4
- Embedded Picture MimeType... HOT 2
- Embedded Picture Cover Type... HOT 1
- Embedded Picture Invalid ID3 frame size.. HOT 3
- Feature Request: perfect opus merging without 'click' HOT 1
- Tone tagging takes a long time for some files HOT 17
- Tone corrupts some m4b files, rendering them unable to play in ABS HOT 11
- Issue when enhancing `musicbrainz.js` script to incorporate chapters HOT 2
- Feature Request: Import chapter from CUE Sheet HOT 5
- tone v0.1.7 reports version 0.1.6 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tone.