Hi there,
i'm new to WMS and quite bad at scripting. ;-(
so..
Is it possible to create a collection named like "Movies added in the last 30 days", where all Movies, added within the the last month, ordered by their file-creation date are listed?
Thanks!
Create automated playlists
Re: Create automated playlists
Hi,
May be useful: Settings - Additional - Events - "After adding of media resource at scanning" - "After addition of media resource at scanning": Adding new media resources to a folder "Playlists\Recently Added"mic wrote:
i'm new to WMS and quite bad at scripting. ;-(
so..
Is it possible to create a collection named like "Movies added in the last 30 days", where all Movies, added within the the last month, ordered by their file-creation date are listed?
Re: Create automated playlists
thx for your fast answer..
but..
- i can't find that setting: "Adding new media resources to a folder "Playlists\Recently Added" " ?
EDIT: SRY, tried it! Function working, but second question is still 'active'
- and.. thats not exactly what i'm trying to do.. I want a folder, which includes all files not older than one month (creation date on disk), all the time. If i start WMS on 10/12/2010 all movies created between 11/11/2010 and 10/12/2010 are in that folder. If if use wms two days later all files created between 13/11/2010 and 12/12/2010 should be listed.
I think thats only possible with scripting?
but..
- i can't find that setting: "Adding new media resources to a folder "Playlists\Recently Added" " ?
EDIT: SRY, tried it! Function working, but second question is still 'active'
- and.. thats not exactly what i'm trying to do.. I want a folder, which includes all files not older than one month (creation date on disk), all the time. If i start WMS on 10/12/2010 all movies created between 11/11/2010 and 10/12/2010 are in that folder. If if use wms two days later all files created between 13/11/2010 and 12/12/2010 should be listed.
I think thats only possible with scripting?
Re: Create automated playlists
1. Folder Collectionsmic wrote: - and.. thats not exactly what i'm trying to do.. I want a folder, which includes all files not older than one month (creation date on disk), all the time. If i start WMS on 10/12/2010 all movies created between 11/11/2010 and 10/12/2010 are in that folder. If if use wms two days later all files created between 13/11/2010 and 12/12/2010 should be listed.
I think thats only possible with scripting?
2. Right click - Add Folder
3. Title: Movies added in the last 30 days
4. Type: Dynamic (Script)
5. Click Script
6.
Code: Select all
var
i: Integer;
AllMoviesFolder: TWmsScriptMediaItem;
begin
AllMoviesFolder := WmsFindMediaFolder(mfVideoAllMoviesItemID);
if AllMoviesFolder <> nil then
for i := 0 to AllMoviesFolder.ChildCount - 1 do
if Date - StrToDateTime(AllMoviesFolder.ChildItems[i].Properties[mpiFileDate]) <= 30 then
WmsDatabaseAddLink(FolderItem.ItemID, '', AllMoviesFolder.ChildItems[i])
end.
Re: Create automated playlists
Thank you for your help!
Needed to modify the script a little bit to work - i got an error: "" is not a valid date and time
.. i realized that pascal script is easier than i thought
Needed to modify the script a little bit to work - i got an error: "" is not a valid date and time
Code: Select all
var
i: Integer;
AllMoviesFolder: TWmsScriptMediaItem;
begin
AllMoviesFolder := WmsFindMediaFolder(mfVideoAllMoviesItemID);
if AllMoviesFolder <> nil then
for i := 0 to AllMoviesFolder.ChildCount - 1 do
if Date - GetFileDate(AllMoviesFolder.ChildItems[i].Properties[mpiMediaResourceSource]) <= 30 then
WmsDatabaseAddLink(FolderItem.ItemID, '', AllMoviesFolder.ChildItems[i])
end.
Re: Create automated playlists
In the folder "All Movies" may be other folders, in the original script is not checked and not processed
Code: Select all
if not AllMoviesFolder.ChildItems[i].IsFolder then // version 1.07.2
...
Re: Create automated playlists
thx.. but are u sure?
I'm not missing any files in the collection..
I'm not missing any files in the collection..
Re: Create automated playlists
Movies folders, DVD structure folders, BD Playlists - yes, I am sure. If you have everything working, then that is fine.