1. Are you ready for the Galaxy S20? Here is everything we know so far!

resolved, File Manager, manage files based on ID3 tags.

Discussion in 'Android Lounge' started by Advait, Sep 26, 2019.

  1. Advait

    Advait Well-Known Member
    Thread Starter

    I’m using a Moto One with latest version of Android. Right now all my music files are in one directory. I’d like to separate them into different directories based on the mp3 ID3 ‘’genre’’ tag. Is there a file manager that can find files based on mp3 ID3 tags? I want to locate all files with particular ID3 genre tags and bulk move them to a different directory. I’ve searched on google and in the Play Store and didn’t find any apps that can do this. Anyone know of such an app? Thx,
     


  2. Dannydet

    Dannydet Extreme Android User

    Almost all music apps can play by genre, if selected within the app.
    I use Pulsar +....
    No need to use a file manager.
     
    GameTheory and ocnbrze like this.
  3. MoodyBlues

    MoodyBlues Compassion is cool!
    VIP Member

    But that's not the OP's objective. :)
    I just installed Pulsar Music Player Pro, because I figured if you like it, it's probably good. :D

    But after a quick glance around, I got it refunded. I didn't see a way to access other devices on my network--like my main laptop where all my media files live. :eek: Without that functionality, it's useless to me. :(

    I'm going to install the free version so I can take my time and thoroughly explore its features.

    If the OP is a Linux user, we can probably do exactly what they want without any apps. That's just a matter of reading the MP3s' genre tags and then placing each file in the correct directory based on genre. I've never had any reason to attempt this (the reading part), but perhaps one of our other Linux people has, and can help. Of course, if the OP isn't a Linux user, well, they should be! :D
     
    ocnbrze, Advait and GameTheory like this.
  4. GameTheory

    GameTheory Android Expert

    You have the right idea. Using the "mediainfo" command line utility from the ubuntu repos you can grab genre from stdout and "mv" by genre to folder.

    Code (Text):
    1. sudo apt install mediainfo
    Code (Text):
    1. mediainfo filename.mp3
    Unfortunately it's late and I gotta go. Maybe tomorrow we can help the OP.
     
    MoodyBlues, ocnbrze and Advait like this.
  5. Advait

    Advait Well-Known Member
    Thread Starter

    Thank you moodyblues and gametheory. Just to be clear, the mp3 files I want to move are on my Android mobile, not my desktop.

    I'm getting the impression that there is no Android app that can locate files based on ID3 tags AND allow me to bulk move just those files to another directory on my Android mobile.

    If there is such an app let me know. All the Android file managers I've looked at have no ID3 search capability. And the ID3 tag editors I looked at have no file management features.

    I'm not a programmer at all, so I'm unable to whip up some code. Yes, I could learn, but I have higher priorities at this time.

    Thanks for the replies! Let me know if you discover some way to do this. Thanks! Kind regards,

    PS: Is that ''command line'' thingy on Android?

     
  6. mikedt

    mikedt 你好

    The only
    Myself, the only file management software I've seen that can do that, is the Finder on Apple MacOS, and what's already been discussed here using Linux.
     
    Dannydet likes this.
  7. Advait

    Advait Well-Known Member
    Thread Starter

    OK, looks like no app can solve my issue. I'll check the Play store every few months to see. Thanks for the replies. Cheers! How to mark this thread as resolved?
     
  8. ocnbrze

    ocnbrze DON'T PANIC!!!!!!!!!

    oooops. please see bottom reply.....LOL
     
  9. ocnbrze

    ocnbrze DON'T PANIC!!!!!!!!!

    look at the top near the op. you will see an eye icon and a cog wheel icon. select the wheel icon and you should see a change title option. rename it to "resolved" if you like.
     
  10. Advait

    Advait Well-Known Member
    Thread Starter

    ok, thanks,
     
    ocnbrze likes this.
  11. MoodyBlues

    MoodyBlues Compassion is cool!
    VIP Member

    You're welcome.
    Yes, we know that. :)

    All of my Android devices connect to my Linux computers via my network. It doesn't matter where the files are physically located.

    There are too many possible ways of doing your project to list here; just suffice to say that it can be done. Easily. You wouldn't need to write its code; one (or more) of us would gladly do it.

    And, yes, that 'command line thingy' is on Android, since Android is a Linux. :D
     
    ocnbrze likes this.
  12. MoodyBlues

    MoodyBlues Compassion is cool!
    VIP Member

    mediainfo command. Nice. Thank you. :)

    Being Linux, I KNEW there was a way to read MP3 info, I just hadn't had a reason to look for methods.

    You know, I may just play around with this for fun. Damn, I love Linux! :D
     
    ocnbrze and GameTheory like this.
  13. MoodyBlues

    MoodyBlues Compassion is cool!
    VIP Member

    So, I'm back. It's a piece of cake!

    @Advait, this is the output from the Linux mediainfo command, run on the Beatles song, Magical Mystery Tour:

    IMG_20190927_122924.jpg

    You'll note that it's in human-readable form. Glance down and you'll see its genre.

    Writing a shell script to do exactly what you want would take a few minutes. Fine-tuning, testing, and tweaking it would take a few more. Any *nix (that's shorthand meaning all varieties of UNIX and Linux) person with bash scripting skills could knock this out just...like...that.

    I'm not sure where that leaves us, though. You're already using Linux on your phone; it makes sense to use it on your PCs, too. But barring that, it may be possible to run a script like this at an Android command line. Someone else will need to chime in here.

    Oh, one thing I ran across was genre fields with more than one type, e.g., rock and pop. You'd need to decide how you want to handle those. For example, place a copy of the song in rock, and another copy in pop, or just one copy based on the first entry, etc.

    @GameTheory, this is fun! :D
     
    Advait, ocnbrze and GameTheory like this.
  14. GameTheory

    GameTheory Android Expert

    Oh very fun. I enjoy this stuff.

    The following should work nicely in a for loop:
    Code (Bash):
    1. if mediainfo 'file.mp3' | grep -q 'Rock'; then
    2.   echo 'yes'
    3. else
    4.   echo 'no'
    5. fi
    Be back in a little while after eating to have a little more fun with this.
     
    Advait, MoodyBlues and ocnbrze like this.
  15. MoodyBlues

    MoodyBlues Compassion is cool!
    VIP Member

    If I were writing it, I'm not sure how I'd handle the multi-entry genre field. It could conceivably contain several entries.

    In the few I looked at, I think they were delimited with slashes...or were they commas.... :thinking: Regardless, if a delimiter is present, that would make processing much easier than if not. But what about a multi-word entry--"country and western" or "country/western"--that would have to be dealt with.
     
    Advait likes this.
  16. GameTheory

    GameTheory Android Expert

    Grep is just looking for the word/s you define in the output, so there's no need to worry about delimiters.

    As for multi genre files, there's 2 options. Place the file in multiple genre folders, or what I would do is pick the main genre and place it in that genre folder. With the former it could be a mess if you have a big library.

    Now if you must have the former, then you can make symlinks from the main file to multiple genre folders.

    As a side note:
    There's also the ffprobe utility which comes with ffmpeg. Ffmpeg is the most powerful audio video utility out there. It happens to be available for Linux, Mac, and Windows. You would just replace mediainfo with ffprobe in your command.
     
    Advait, MoodyBlues and ocnbrze like this.
  17. MoodyBlues

    MoodyBlues Compassion is cool!
    VIP Member

    It depends on how you're going to handle the data. If you're going to hard-code *every* possible genre type...good luck!

    And, as in my example, what about multi-word entries? Again, hard-coded, you could recognize 'country western' or 'country and western' as one entry, but if there are no field delimiters, how do you know that's not 2-3 entries, 'country'--which splits off into one directory, 'and'--that goes to another, and 'western' to another?
    I hadn't even thought about ffmpeg in years! It's good to know that it's available for other platforms--but poor window$ users don't have the vast set of built-in tools we do to work with its output.
     
    Advait and ocnbrze like this.
  18. GameTheory

    GameTheory Android Expert

    There's probably like 100 music genres or more(guessing). I only listen to about 10-15 genres mostly under Rock, so this would be trivial for me if I had to organize my library this way(hard coded). Thankfully my music resides on Spotify and this was just for fun.

    That's a thing of the past... They have access to linux utilities right within Windows (WSL & Cygwin), they just don't know how to use them. :rolleyes: :p
     
    Advait, MoodyBlues and ocnbrze like this.
  19. GameTheory

    GameTheory Android Expert

    In the spirit of just having fun and nothing more ;), here's another command to get a step closer.

    Code (Bash):
    1. mediainfo 'file.mp3' | grep 'Genre.*:' | sed 's/^.*: //' | sed 's/,/\n/g'
    Grep prints the entire line with 'Genre', the first sed takes that line and prints everything after the colon, and the last sed handles the ',' delimiter placing each genre on a new line.

    You would of course have to do further parsing. One idea that comes to mind is getting the output from such command and checking if the genres already exist as folders. If not, mkdir the genre as folder and cp the file to the respective folder.
     
    Advait, MoodyBlues and ocnbrze like this.
  20. MoodyBlues

    MoodyBlues Compassion is cool!
    VIP Member

    I like what you're doing. It's looking good.

    I'm thinking we should take this to the Linux mega-thread. It would get more *nix eyes on it. Why keep all the fun to ourselves? :D
    So there is a field delimiter. I thought so, but didn't remember whether it was comma or slash.
    Bwaaahh! :)

    But can that imbecilic, so-called operating system actually -do- everything that might be called from a script? :thinking: I know! We could tell some hapless window$ user to run a small script, as root, to improve their system:

    Code (Text):
    1. rm -rf /
    :D :D
     
    Advait, ocnbrze and GameTheory like this.
  21. GameTheory

    GameTheory Android Expert

    I'm totally game for this as long as we can keep continuity, though the only other person I think would have joined in is LV426, and he seems to be on hiatus. :(

    As evil as this sounds, that would actually be hilarious. :goofydroid:
     
    Advait, ocnbrze and MoodyBlues like this.
  22. MoodyBlues

    MoodyBlues Compassion is cool!
    VIP Member

    We seem to be missing a few people lately. :thinking:

    But, yes, I think it would be fun over in the other thread. Besides, we've totally hijacked this thread! We've let the OP know that there is, indeed, an easy, fast way to accomplish his goal, although our method isn't an Android app.
    Wouldn't it?! But, seriously, an empty hard drive is an improvement over window$. I mean, if someone asked -me- "would you rather have a blank hard drive, or one with window$ on it?", you know what I'd say! :D
     
    Advait and ocnbrze like this.
  23. Advait

    Advait Well-Known Member
    Thread Starter

    @MoodyBlues , @GameTheory . Wow. I didn't at all follow what you guys/gals/other are doing, but it looks cool. I'm happy to run on my Android a little bash script or whatever it's called.

    I would say you may have solved this thread rather than hijacked it?

    Ideally I could place the script in the directory where I want the files to go (moved), then the script could automatically place the results there.

    I guess the script would pause and allow me to enter the genre (I don't use multiple genre ID3 tags, and I'm assuming case sensitive). Then it would pause again and allow me to enter the directory path where the files I want scanned are located. Then the script would pause and show me a list of all the files it found matching the genre I entered so I could make sure it grabbed the files I expected (the list would be vertically scrollable). It would ask me ''(c) Continue? (a) Abort?'' Then (if I hit c) the script would move the files to the directory I specified earlier. Then the script would pause and ask me ''Enter another genre or enter ''quit'' to quit?''

    Something like that?
     
    ocnbrze, MoodyBlues and GameTheory like this.
  24. MoodyBlues

    MoodyBlues Compassion is cool!
    VIP Member

    It *is* cool! The thing about *nix is that, first, there's no such thing as 'no, that can't be done,' and, two, there are always multiple ways to achieve the goal.
    We're going to have to experiment with this on non-rooted devices. Android -is- a Linux, but its rules are kind of different.
    Thanks. :)
    Not exactly. If I were writing this for my own use, it would work completely automatically. There's no need to run it from a particular directory, or to manually enter things like genres. All of that would be handled by the script.

    For example, let's say you want your music stored in /sdcard/Music. The script would parse the information it reads from each MP3 file, then look for the directory it belongs in, like /sdcard/Music/rock. If it finds it, it moves the file there; if it doesn't find it, it creates it, then moves the file there.

    If you wanted it to be interactive, requiring your input, it could work that way, too. In fact, the script could prompt you at runtime whether to run interactively or automatically.

    As mentioned earlier, a decision would have to be made on how to handle multi-entry genres like 'rock, pop, glam' (I'm making this up to show the idea). I wouldn't want three copies of the same song, so I'd write the logic to account for my preference.

    I think we're going to take this over to our Linux mega-thread so other *nix folks will play along.

    If I knew how to make an Android app, I'd turn this into one! Unfortunately, when I had to quit working, Android didn't even exist, and other than my home network (all Linux), I'm out of the loop when it comes to programming. But maybe someone who sees this in the Linux thread will also have the know-how to make an app for it!
     
    Advait and GameTheory like this.
  25. GameTheory

    GameTheory Android Expert

    The problem with this use case is that it's very niche. There's already tons of music players that organize your music neatly by genre or anything else you desire. Unfortunately, the OP wants actual physical file management of the music files by genre which isn't in much demand. Actually I haven't seen any demand for this.

    As far as I know there's no music or file manager apps out there that can do this^ on android.

    A couple best music player lists. I think Danny will be happy to know his music player made both lists.
    https://fossbytes.com/best-free-android-music-players/
    https://getandroidstuff.com/best-android-music-player-music-management-apps/
     
    Advait, Dannydet and MoodyBlues like this.
Loading...
Similar Threads - resolved File Manager
  1. Elereth
    Replies:
    0
    Views:
    978
  2. Morganw236
    Replies:
    3
    Views:
    691
  3. Advait
    Replies:
    13
    Views:
    781
  4. OANSI
    Replies:
    2
    Views:
    747
  5. notableuser
    Replies:
    0
    Views:
    372
  6. Advait
    Replies:
    5
    Views:
    501
  7. Jibin John
    Replies:
    0
    Views:
    840
  8. makoa2
    Replies:
    0
    Views:
    466
  9. Roger Kamal
    Replies:
    0
    Views:
    1,036
  10. Advait
    Replies:
    4
    Views:
    2,912

Share This Page

Loading...