Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing issue #353 Forward Slash in site or channel name causes recording error #448

Conversation

whelgeson
Copy link
Contributor

Moved replaceIllegalCharacters method into StringUtils.
Modified classes that write out to disk to call this method when saving a file.

Moved replaceIllegalCharacters method into StringUtils.
Modified classes that write out to disk to call this method when saving a file.
Copy link
Owner

@DSheirer DSheirer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much for the pull request. I added a couple comments with some changes needed for linux compatibility. If you could make those changes, I'll test it again on linux and we should be able to get your updates into the codebase. Thanks! Denny

@@ -225,7 +226,7 @@ private String getFilePrefix(ReusableAudioPacket packet)
}
}

return sb.toString();
return StringUtils.replaceIllegalCharacters(sb.toString());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please move the clean method to where each of the System/Site/Name values are added. Otherwise, the clean method causes invalid linux filepaths.

    sb.append(metadata.hasChannelConfigurationSystem() ? StringUtils.replaceIllegalCharacters(metadata.getChannelConfigurationSystem()) + "_" : "");
    sb.append(metadata.hasChannelConfigurationSite() ? StringUtils.replaceIllegalCharacters(metadata.getChannelConfigurationSite()) + "_" : "");
    sb.append(metadata.hasChannelConfigurationName() ? StringUtils.replaceIllegalCharacters(metadata.getChannelConfigurationName()) + "_" : "");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this suggestion a little bit to encompass the 'metadata.getPrimaryAddressTo().getIdentifier()' calls as well. My thinking is that it may somehow be possible to have an illegal char in the identifier.

@DSheirer DSheirer merged commit 72fe72c into DSheirer:master Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants