Page 1 of 1
Collections
Posted: Fri Feb 19, 2010 7:56 am
by Merlin
Hello,
Is there the possibility to include an option for the collections that you can specify witch files automatically included into the collection by there name?
I try to give an example:
I have an collection named "xyz abc" and I specify the file name pattern "xyz abc - S01*" at this collection.
And now, all Files (new scanned an already included) witch begins with "xyz abc - S01" are automatically included in this Collection.
You know what I mean?
Best regards,
Martin
Re: Collections
Posted: Fri Feb 19, 2010 8:22 am
by Eugene
Hello,
Merlin wrote:
Is there the possibility to include an option for the collections that you can specify witch files automatically included into the collection by there name?
I try to give an example:
I have an collection named "xyz abc" and I specify the file name pattern "xyz abc - S01*" at this collection.
And now, all Files (new scanned an already included) witch begins with "xyz abc - S01" are automatically included in this Collection.
You know what I mean?
Best regards,
Martin
This can be done through the processing of media resources (Settings-Processing-Add)
Name: Create Serials Index
Click "Button on the main form"
Expression:
Code: Select all
function GetProperty(aItem: TWmsScriptMediaItem; aPropertyID: Integer): string;
begin
Result := VarToStr(aItem.Properties[aPropertyID]);
if Result = '' then
Result := 'Unknown'
end;
procedure ProcessItem(aItem: TWmsScriptMediaItem);
var
i: Integer;
sCollectionPath, sSerialsFolder, sFileName: string;
begin
sFileName := ExtractFileName(GetProperty(aItem, mpiFilePath));
sSerialsFolder := Copy(sFileName, 1, 7);
if MatchText(sSerialsFolder, ['aaa 111', 'bbb 111']) then begin
sCollectionPath := 'Serials Index\' + sSerialsFolder + '\';
WmsDatabaseAddLink(mfVideoCollectionsItemID, sCollectionPath, aItem);
end
end;
var
i: Integer;
AllMoviesFolder, SerialsIndexFolder: TWmsScriptMediaItem;
begin
AllMoviesFolder := WmsFindMediaFolder(mfVideoAllMoviesItemID);
if (AllMoviesFolder <> nil) and (AllMoviesFolder.ChildCount > 0) then begin
WmsShowProgress('Create Serials Index...');
try
SerialsIndexFolder := WmsFindMediaFolder(mfVideoCollectionsItemID, 'Serials Index');
if SerialsIndexFolder <> nil then
SerialsIndexFolder.DeleteChildItems;
for i := 0 to AllMoviesFolder.ChildCount - 1 do begin
if WmsCancelPressed then
Break
else begin
ProcessItem(AllMoviesFolder.ChildItems[i]);
WmsSetProgress(Round(((i + 1) / AllMoviesFolder.ChildCount) * 100))
end
end
finally
WmsHideProgress
end;
if WmsCancelPressed then
MessageDlg('Creating Serials Index interrupted by the user.', mtError, mbOK, 0)
else begin
WmsDatabaseAutoSave;
MessageDlg('Creating Serials Index is succesful.', mtInformation, mbOK, 0)
end
end else
MessageDlg('No files to process.', mtError, mbOK, 0);
ProcessMediaResult := True
end.
Must change the line
Code: Select all
if MatchText(sSerialsFolder, ['aaa 111', 'bbb 111']) then begin
Re: Collections
Posted: Sat Feb 27, 2010 7:07 pm
by ogre111
Eugene wrote:
Must change the line
Code: Select all
if MatchText(sSerialsFolder, ['aaa 111', 'bbb 111']) then begin
I made a collection
House and i want a file named
House.S06E13.HDTV.XviD-XII to be added to the collection, then I have to change it to
Code: Select all
if MatchText(sSerialsFolder, ['House', 'House']) then begin
?
I did it, and it doesn't work.