WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> How to... >> Create / Add to Video Playlist
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1376838190

Message started by RJG on Aug 18th, 2013 at 5:03pm

Title: Create / Add to Video Playlist
Post by RJG on Aug 18th, 2013 at 5:03pm
Not sure where my original thread went so I figured I would start another.

what I'm looking to do is to create a video playlist that the Western Digital Live media player can read.

It appears that it can read a .m2u file with entries like below.

[code]..\TBBT\08-11-2013\TheBigBangTheory-S01E15-ThePorkChopIndeterminacy-20959191-0-cln.ts
..\TBBT\08-11-2013\TheBigBangTheory-S01E16-ThePeanutReaction-20959192-0-cln.ts
..\Wipeout\08-15-2013\Wipeout-S06E12-BeautyQueens-20768670-0-cln.ts[/code]

How can I have WD create the file if the file does not exist, and then add a new entry to this file. (I guess with the newest items at the top.)

Thanks

Title: Re: Create / Add to Video Playlist
Post by Gert on Aug 19th, 2013 at 7:23am
Hi,

The forum had a problem a few days ago and some threads were lost.

What you can try is use the "run a .bat file" task to monitor for new ts files and let it start the following .bat file
[code]SET M2U=C:\My Files\playlist.m2u
ECHO %WD_FILE% >> "%M2U%"
[/code]

This will append the filenames to the m2u file.

Title: Re: Create / Add to Video Playlist
Post by RJG on Aug 22nd, 2013 at 1:54am

Gert wrote on Aug 19th, 2013 at 7:23am:
Hi,

The forum had a problem a few days ago and some threads were lost.

What you can try is use the "run a .bat file" task to monitor for new ts files and let it start the following .bat file
[code]SET M2U=C:\My Files\playlist.m2u
ECHO %WD_FILE% >> "%M2U%"
[/code]

This will append the filenames to the m2u file.


Thank you so much Gert, that worked perfectly with 2 exceptions.

1) the .m3u entries must be in this format

Here is the string where the file is being copied to:

\\SERVER\Videos\TV Shows\1 RECORDINGS\Longmire\08-19-2013\Longmire-S02E12-AGoodDeathIsHardtoFind-21050089-0-cln.ts

Here is what the string must look like inside the .m3u playlist:

..\Longmire\08-19-2013\Longmire-S02E12-AGoodDeathIsHardtoFind-21050089-0-cln.ts

2) Is there a way to have the new entries at the beginning of the playlist?


As always, thanks for all your help.


Title: Re: Create / Add to Video Playlist
Post by Gert on Aug 22nd, 2013 at 7:33am
This version fixes the filename (maybe the "37" is one off, and you need to add or subtract 1 for it to work properly)

Code (]
SET M2U=C:\My Files\playlist.m2u
rem only use the filename starting from position 37 and prefix with ..
SET LI=..%WD_FILE:~37%
ECHO %LI% >> "%M2U%"
[/code):

Inserting a line as the FIRST line is possible, but will be slow if the file grows bigger. Let me know if you REALLY want that,
Here is an alternative that may be good enough for your needs. It creates a NEW m2u file named after the current date (yyyymmdd),
[code]
SET M2U=C:\My Files\playlist_%WD_DATE%.m2u
rem only use the filename starting from position 37 and prefix with ..
SET LI=..%WD_FILE:~37%
ECHO %LI% >> "%M2U%"


Title: Re: Create / Add to Video Playlist
Post by RJG on Aug 23rd, 2013 at 4:03am

Gert wrote on Aug 22nd, 2013 at 7:33am:
This version fixes the filename (maybe the "37" is one off, and you need to add or subtract 1 for it to work properly)

Code (]
SET M2U=C:\My Files\playlist.m2u
rem only use the filename starting from position 37 and prefix with ..
SET LI=..%WD_FILE:~37%
ECHO %LI% >> "%M2U%"
[/code):

Inserting a line as the FIRST line is possible, but will be slow if the file grows bigger. Let me know if you REALLY want that,
Here is an alternative that may be good enough for your needs. It creates a NEW m2u file named after the current date (yyyymmdd),
[code]
SET M2U=C:\My Files\playlist_%WD_DATE%.m2u
rem only use the filename starting from position 37 and prefix with ..
SET LI=..%WD_FILE:~37%
ECHO %LI% >> "%M2U%"


Gert; you're amazing. Worked perfectly.

Once again, THANK YOU!



WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.