INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Feature Request: Path Rewrite  (Read 8170 times)

MediaMike

  • Member
  • *
  • Posts: 3
Feature Request: Path Rewrite
« on: July 22, 2015, 03:55:14 pm »

Hi all, I'd like to use MC from various different clients using the same physical database. In general MAC and Windows MC do read the same database but the machines are using different paths to access the files on a central media server. As a result the other client does not find the file. E.g.
 
Windows uses UNC type path names and back slashes: \\mediaserver\music_lib\Music\<artist>\...
MAC OSX (and Linux) uses mounts and forward slashes: /mnt/music_lib/Music/<artist>/...

It would be nice if I could configure rules to translate the stored pathnames from UNC format to Linux style (and vice versa). It would require to replace a prefix and translate slashes into back slashes (and vice  versa).

XBMC aka KODI offers such a feature which is really useful in a diverse environment.

Many thanks.

Kind regards,
Michael
Logged

JohnT

  • Citizen of the Universe
  • *****
  • Posts: 4627
Re: Feature Request: Path Rewrite
« Reply #1 on: July 23, 2015, 09:12:03 am »

I agree this would be a nice feature to add.  Here are some use cases:

1. copying a library from one platform to another (i.e. Windows to Mac).
2. when a user moves their media collection to another location
3. when using the same physical MC library from multiple computers (your example)
4. on a media server client with the option "Play local file if one that matches Library Server file is found" enabled

We've done some brainstorming in the past on the best approach to the problem.  Seems like when MC finds a batch of unlinked files, it could search for a path substitution that would re-link them and query the user whether it should proceed with the substitution.  The user could accept the auto-generated substitution or manually create a substitution by browsing to the correct location of one or more of the un-linked files.
Logged
John Thompson, JRiver Media Center

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4226
Re: Feature Request: Path Rewrite
« Reply #2 on: July 23, 2015, 09:21:30 am »

+1 to this, I raised the point a while ago as https://yabb.jriver.com/interact/index.php?topic=94080.0

why isn't it just a question of jriver tokenising the value as it stores it in its database? you have to pick various paths as the root for all this content anyway after all so replacing that as $MOVIES_ROOT$ (or whatever) seems like it would be sufficient
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Feature Request: Path Rewrite
« Reply #3 on: July 23, 2015, 09:47:30 am »

+1 to this, I raised the point a while ago as https://yabb.jriver.com/interact/index.php?topic=94080.0

why isn't it just a question of jriver tokenising the value as it stores it in its database? you have to pick various paths as the root for all this content anyway after all so replacing that as $MOVIES_ROOT$ (or whatever) seems like it would be sufficient
We agree in principle.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4226
Re: Feature Request: Path Rewrite
« Reply #4 on: July 24, 2015, 08:12:19 am »

We agree in principle.
sounds promising, I will live in hope :)
Logged

MediaMike

  • Member
  • *
  • Posts: 3
Re: Feature Request: Path Rewrite
« Reply #5 on: July 24, 2015, 04:18:04 pm »

+1 to this, I raised the point a while ago as https://yabb.jriver.com/interact/index.php?topic=94080.0

why isn't it just a question of jriver tokenising the value as it stores it in its database? you have to pick various paths as the root for all this content anyway after all so replacing that as $MOVIES_ROOT$ (or whatever) seems like it would be sufficient

I have not fully thought it through but I think the token approach would meet my requirements in an easy fashion. I would then define the variable locally on my client and could then easily do some search and replace to fix the database. It also addresses the issue when running imports from different clients. The prefix would be recognized and replaced by the variable before storing into the database. This could not be achieved by path substitution. However a regex like path substitution would still be needed to adjust path separators (forward / back slashes).

I will be looking forward to seeing that feature.

Kind regards
Michael
Logged

JohnT

  • Citizen of the Universe
  • *****
  • Posts: 4627
Re: Feature Request: Path Rewrite
« Reply #6 on: July 27, 2015, 07:58:57 am »

I have not fully thought it through but I think the token approach would meet my requirements in an easy fashion. I would then define the variable locally on my client and could then easily do some search and replace to fix the database. It also addresses the issue when running imports from different clients. The prefix would be recognized and replaced by the variable before storing into the database. This could not be achieved by path substitution. However a regex like path substitution would still be needed to adjust path separators (forward / back slashes).

I will be looking forward to seeing that feature.

Kind regards
Michael
Michael, could you describe in some detail how you are accessing your library from clients?   There are many possible permutations and I want to make sure I understand your use case.  Thanks.
Logged
John Thompson, JRiver Media Center

georgethesixth

  • Recent member
  • *
  • Posts: 19
Re: Feature Request: Path Rewrite
« Reply #7 on: July 27, 2015, 10:29:20 am »

If you are working on this, could you also think about restructuring a file system based on metadata ?
A way to make sure the path name length stays within the limits of the file-system would also be handy.

An old car I love has a good but outdated sound system. It uses only the file structure to show music.  I now use   Softpointer Tag and Rename to reorganise the library every so often.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10933
Re: Feature Request: Path Rewrite
« Reply #8 on: July 27, 2015, 10:32:46 am »

If you are working on this, could you also think about restructuring a file system based on metadata ?

This already exists, check "Library Tools -> Rename, Move & Copy Files", you can re-organize the physical storage of the files according to any tags or expressions.
Logged
~ nevcairiel
~ Author of LAV Filters

georgethesixth

  • Recent member
  • *
  • Posts: 19
Re: Feature Request: Path Rewrite
« Reply #9 on: July 27, 2015, 11:14:12 am »

Thanks Hendrik.  I thought I looked everywhere ...  :-[
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Feature Request: Path Rewrite
« Reply #10 on: July 27, 2015, 11:51:19 am »

This already exists, check "Library Tools -> Rename, Move & Copy Files", you can re-organize the physical storage of the files according to any tags or expressions.

More info:
http://wiki.jriver.com/index.php/Rename,_Move,_and_Copy_Files
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Feature Request: Path Rewrite
« Reply #11 on: July 27, 2015, 11:53:01 am »

Michael, could you describe in some detail how you are accessing your library from clients?   There are many possible permutations and I want to make sure I understand your use case.  Thanks.

By the way, I'm very interested in this, though I haven't had time to read this thread in detail.

I'll try to comment later tonight.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

MediaMike

  • Member
  • *
  • Posts: 3
Re: Feature Request: Path Rewrite
« Reply #12 on: July 28, 2015, 04:43:51 pm »

Michael, could you describe in some detail how you are accessing your library from clients?   There are many possible permutations and I want to make sure I understand your use case.  Thanks.

Sorry for the lengthy note, but I am trying to give a complete answer: I do have a Linux based server hosting all media files, covers and the libraries. The files are shared by SMB as the majority of the clients are Windows based. Right now I do have the following setup:

The Linux server provides the following SMB shares:

Library files and covers:\\mediaserver\shared\
Music files:\\mediaserver\music_lib\
Video files:\\mediaserver\video_lib\

Under Windows I historically use drive mappings but I am in the process to change to UNC paths. With Mac OS (or other Unixoide systems) I would need to mount the remote paths into the local filesystem.

Content     Win DriveWin UNCMac OS/X
Library:     S:\\\mediaserver\shared\~/mnt/share
Music files:T:\\\mediaserver\music_lib\~/mnt/music_lib
Video files:U:\\\mediaserver\video_lib\~/mnt/video_lib

Following the mappings above the same physical file "(1) Sample.mp3" would be found by

Win: T:\CDs\Artist\Title\(01) Sample.mp3
Mac: ~/mnt/music_lib/CDs/Artist/Title/(1) Sample.mp3

With the "token" approach from above, I would set the following variables on the clients:

VariableWindowsMac OS/X
$MUSIC:T:\~/mnt/music_lib/
$VIDEO:V:\~/mnt/video_lib/

Pending on the Client MC would then store the filename as
WIN: $MUSIC, CDs\Artist\Title\(01) Sample.mp3
MAC: $MUSIC, CDs/Artist/Title/(01) Sample.mp3

With the exception of the different path separator \ or / everything looks fine. I appreciate that during scan a clever mechanism to identify the appropriate token need to be found. Probably longest match would be a good approach. You would also need to consider case sensitivity in Linux and case insensitivity with Windows.

Does that make sense?

Regards,
Michael
Logged

rito

  • Recent member
  • *
  • Posts: 10
Re: Feature Request: Path Rewrite
« Reply #13 on: July 29, 2015, 03:29:20 am »

This already exists, check "Library Tools -> Rename, Move & Copy Files", you can re-organize the physical storage of the files according to any tags or expressions.

Yup, this works great EXCEPT for SACD ISOs  ::)
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient
Re: Feature Request: Path Rewrite
« Reply #14 on: July 29, 2015, 08:37:39 am »

With the exception of the different path separator \ or / everything looks fine. I appreciate that during scan a clever mechanism to identify the appropriate token need to be found.

I would appreciate an opportunity for the user to specify the token/base path (separately on each machine).  Auto-detection would be nice, but I'd like to be able to override any auto-detection in case of subtly different mappings (for example with filepaths too long for windows).

Quote
You would also need to consider case sensitivity in Linux and case insensitivity with Windows.

Also windows filepath limits and shell expansion characters.

I'm excited about this.  This would remove another obstacle to total linux server domination  ;D
Logged

AlexS

  • World Citizen
  • ***
  • Posts: 233
Re: Feature Request: Path Rewrite
« Reply #15 on: August 16, 2015, 07:28:36 pm »

Sorry for the lengthy note, but I am trying to give a complete answer: I do have a Linux based server hosting all media files, covers and the libraries. The files are shared by SMB as the majority of the clients are Windows based. Right now I do have the following setup:

The Linux server provides the following SMB shares:

Library files and covers:\\mediaserver\shared\
Music files:\\mediaserver\music_lib\
Video files:\\mediaserver\video_lib\

Under Windows I historically use drive mappings but I am in the process to change to UNC paths. With Mac OS (or other Unixoide systems) I would need to mount the remote paths into the local filesystem.

Content     Win DriveWin UNCMac OS/X
Library:     S:\\\mediaserver\shared\~/mnt/share
Music files:T:\\\mediaserver\music_lib\~/mnt/music_lib
Video files:U:\\\mediaserver\video_lib\~/mnt/video_lib

Following the mappings above the same physical file "(1) Sample.mp3" would be found by

Win: T:\CDs\Artist\Title\(01) Sample.mp3
Mac: ~/mnt/music_lib/CDs/Artist/Title/(1) Sample.mp3

With the "token" approach from above, I would set the following variables on the clients:

VariableWindowsMac OS/X
$MUSIC:T:\~/mnt/music_lib/
$VIDEO:V:\~/mnt/video_lib/

Pending on the Client MC would then store the filename as
WIN: $MUSIC, CDs\Artist\Title\(01) Sample.mp3
MAC: $MUSIC, CDs/Artist/Title/(01) Sample.mp3

With the exception of the different path separator \ or / everything looks fine. I appreciate that during scan a clever mechanism to identify the appropriate token need to be found. Probably longest match would be a good approach. You would also need to consider case sensitivity in Linux and case insensitivity with Windows.

Does that make sense?

Regards,
Michael

+1 to all this.
The library format should be portable across all supported operating systems. A user should be able to specify the root of each library entry for each OS (via rules or whatever). When parsing the library, if the folder root is not found a dialogue popup should appear prompting for a new root (or rule or whatever).

I am finding it very hard to use the same media folders in Windows and in Linux. I've written more about this in the Linux forum.

Thanks..
Logged
Pages: [1]   Go Up