|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Help with removeall in eclipse
I am having a issue where it doesn't seem to return anything for the string (TagRemoved) attached code
I have checked the true false portion and it is working as intended but for some reason the hangup seems to be at the Tagremoved. TIA as I am new to learning eclipse but love it so far. http://babgvant.com/downloads/PLUCKYHD/tagremoved.jpg |
#2
|
|||
|
|||
Got this one fixed using replaceAll and changing it around a bit.
|
#3
|
||||
|
||||
plucky, after looking at your code, there is a couple of issues... firstly, you've declared a method java_lang_string_replaceAll() that just returns null... so not matter what you pass in, it will always return null.
Also, your java code doesn't contain any null checking. that means, that you'll most likely run into java exceptions in the cases where no MediaTags are assigned to an item. Those exceptions,if they make it up to the STV, will result in a huge performance hit. consider the following for your removeall method Code:
public static String RemoveMediaTag(Object MediaFile, String tag) { String tags = MediaFileAPI.GetMediaFileMetadata(MediaFile, "MediaTags"); String newTags = null; if (tags!=null) { newTags = tags.replaceAll(tag, ""); newTags = newTags.replaceAll(";;",";"); if (!tags.equals(newTags)) { MediaFileAPI.SetMediaFileMetadata(MediaFile, newTags); } } return newTags; }
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#4
|
|||
|
|||
Quote:
Stuckless thanks I do check for nulls in others and you are correct I completely left it out on this one Thanks for the tips I really appreciate it. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|